필터 지우기
필터 지우기

Deleting row/column iteratively of a correlation matrix

조회 수: 12 (최근 30일)
Ansh
Ansh 2018년 12월 16일
댓글: Ansh 2018년 12월 23일
Hi guys,
So I have a correlation matrix E which is quite large. Some of the individual (i,j) entries have E(i,j)>0.95 (or similar high values). I want to remove the j row/column in the correlation matrix since the correlations of j can be explained by i anyway (i and j are highly correlated). I want to do this for all such (i,j) pairs (this will have to be done iteratively for each entry where E(i,j)>0.95). However, I would also like a record of the j removed from the original matrix. For example:
E= 1 0.97 0.4
0.97 1 0.38
0.4 0.38 1
Hence I want the algorithm to select E(1,2) entry, and delete the second row and column. It will then move to the second such E(i,j)>0.95 and record the j removed ( but I would like to know what column/row j that has been removed from the original matrix). The output of the code will be the reduced matrix and the column/rows j deleted from the original matrix E.
Thank you so much for all your help!

채택된 답변

Matt J
Matt J 2018년 12월 16일
편집: Matt J 2018년 12월 16일
I see no need to do it iteratively. It can be done as a one-step process.
remove=any(E>0.95);
E=E(~remove,~remove);
  댓글 수: 1
Ansh
Ansh 2018년 12월 23일
Hi, yes I think I was severely over complicating a very simple problem. Sorry for the late acceptance and thank you for your help. I also forgot to add that I have taken out the trivial diagonal 1 cases (correlation matrix)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by