Correlation between multiples items
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Davide Sinesi
am 24 Okt. 2019
Beantwortet: Subhadeep Koley
am 31 Okt. 2019
Hello, Could I get a range of items less correlated from a correlation matrix?
For example from:
A, B, C, D, E ... N
A,
B
C
D
E
...
N
Output: items less correlated are ''A,D,E''
I only need a multiple combination of items that are less correlated each others. (A - D), (A - E), (D - E)
Sorry for my English...
Thank you everyone!
Best regards
4 Kommentare
John D'Errico
am 30 Okt. 2019
Seriously, this question has nothing to do with MATLAB. Your question is too vague to have an answer.
So spend some time and think about exactly what you need, in terms of mathematics (or statistics). That may involve asking questions on another forum, perhaps a statistics forum. Until you define what problem you are trying to solve, you cannot formulate it in terms of code, in any language.
John D'Errico
am 30 Okt. 2019
Bearbeitet: John D'Errico
am 30 Okt. 2019
By the way, your question, if I interpret it as I wonder if I know where you may be going, may have serious problems anyway.
For example, suppose that you see that A is not highly correlated to B? As well, you might see that B is not highly correlated to C. However, it can still be true that A and C are highly correlated. In fact, A and C may be perfectly correlated to each other. Consider the matrix:
C = [1 0 1;
0 1 0;
1 0 1]
So we have A and B with a zero correlation. Likewise, B and C have zero correlation. But A and C are perfectly correlated.
The relation, "not highly correlated" is not a transitive relation. So be careful in any conclusions that you may draw.
Akzeptierte Antwort
Subhadeep Koley
am 31 Okt. 2019
Use the function below to find out n least correlated items,
function findLeastCorr(corr)
% FINDLEASTCORR finds least correlated items from a given correlation matrix
% INPUT
% -----
% corr_cell - User's correlation matrix
%
% EXAMPLE
% -------
% findLeastCorr(yourCorrMatrix);
%
%
sz = size(corr);
% Sorting from lowest correlatin to highest
[~, corr_ind] = sort(corr(:));
% Finding the index of the least correlated items
prompt = 'How many least correlated items you want?';
n = input(prompt);
items = {1,1,n};
for i=1:n
[a, b] = ind2sub(sz,corr_ind(i));
items{i} = [a, b];
end
% Identify unique elements
items_mat = cell2mat(items);
items_unique = unique(items_mat);
% Displaying the items
disp(['Items less correlated are: ',num2str(items_unique(1:end))]);
end
Hope this helps!
0 Kommentare
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!