|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jqbkfm$1lr$1@newscl01ah.mathworks.com>...
> "Amanmeet " <aman1986@gmail.com> wrote in message <jqbevk$a6i$1@newscl01ah.mathworks.com>...
> > 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
|