MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

# Thread Subject: Eigen decomposition of sum of two very large covariance matrices

 Subject: Eigen decomposition of sum of two very large covariance matrices From: Amanmeet Date: 1 Jun, 2012 22:16:20 Message: 1 of 5 Hi, I want to find the eigen decomposition of the sum of two covariance matrices. the problem is that the covariance matrices are of the size ( 1.6 million x 1.6 million ) . I have not been able to find a method to avoid finding these huge covariance matrices and then computing the eigen decomposition. A1 = matrix of size ( 1.6 Million x 30 ) and A2 = matrix of size ( 1.6 Million x 30 ) Find Eigen decomposition of ( A1A1' + A2A2' ) ... Any help is much appreciated. Regards Amanmeet Garg
 Subject: Eigen decomposition of sum of two very large covariance matrices From: Bruno Luong Date: 1 Jun, 2012 23:50:14 Message: 2 of 5 "Amanmeet " wrote in message ... > Hi, > I want to find the eigen decomposition of the sum of two covariance matrices. the problem is that the covariance matrices are of the size ( 1.6 million x 1.6 million ) . > > I have not been able to find a method to avoid finding these huge covariance matrices and then computing the eigen decomposition. > > A1 = matrix of size ( 1.6 Million x 30 ) and > A2 = matrix of size ( 1.6 Million x 30 ) > > Find Eigen decomposition of ( A1A1' + A2A2' ) ... > p = size(A1,2); % 30 q = size(A1,2); % 30 [Q R]=qr([A1 A2],0); R1 = R(:,1:p); R2 = R(:,p+(1:q)); B = R1*R1'+R2*R2'; % 60 x 60 [W D] = eig(B); V = Q*W; % Now you have the eigen decompositions of A :=A1*A1'+A2*A2', i.e. A*V = V*D; % Bruno
 Subject: Eigen decomposition of sum of two very large covariance matrices From: Amanmeet Date: 7 Jun, 2012 22:41:14 Message: 3 of 5 "Bruno Luong" wrote in message ... > "Amanmeet " wrote in message ... > > Hi, > > I want to find the eigen decomposition of the sum of two covariance matrices. the problem is that the covariance matrices are of the size ( 1.6 million x 1.6 million ) . > > > > I have not been able to find a method to avoid finding these huge covariance matrices and then computing the eigen decomposition. > > > > A1 = matrix of size ( 1.6 Million x 30 ) and > > A2 = matrix of size ( 1.6 Million x 30 ) > > > > Find Eigen decomposition of ( A1A1' + A2A2' ) ... > > > > p = size(A1,2); % 30 > q = size(A1,2); % 30 > [Q R]=qr([A1 A2],0); > R1 = R(:,1:p); > R2 = R(:,p+(1:q)); > > B = R1*R1'+R2*R2'; % 60 x 60 > [W D] = eig(B); > V = Q*W; > > % Now you have the eigen decompositions of A :=A1*A1'+A2*A2', i.e. A*V = V*D; > > % Bruno Hi Bruno,  To my amazement there is a difference in the calculation of the QR decomposition with the two function calls. [Q R]=qr([A1 A2],0); [Q R]=qr([A1 A2]); the one that adds an 0 as a parameter is the economy sized version, and only calculates the eigenvectors till the rank of the matrix. where as the one without the parameter tries and does the full eigendecomposition and then you choose the first few eigenvectors for the non zero eigenvalues. I could not find a reason for the eigenvectors in the two cases to be different. Is there an alternate solution ? OR a possible explanation for this ? Regards Aman
 Subject: Eigen decomposition of sum of two very large covariance matrices From: Bruno Luong Date: 7 Jun, 2012 23:06:09 Message: 4 of 5 "Amanmeet " wrote in message ... > > I could not find a reason for the eigenvectors in the two cases to be different. > Is there an alternate solution ? OR a possible explanation for this ? qr decomposition (without permutation) is not unique if the columns are dependent. Bruno
 Subject: Eigen decomposition of sum of two very large covariance matrices From: Amanmeet Garg Date: 8 Jun, 2012 00:33:18 Message: 5 of 5 Hi Bruno,  Thank you for the explanation. It helps. Regards Aman