Eigenvalue computation for large matrix
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi there -
I want to compute the eigenvalues of the matrix (1/T)*A'A, where A is a Txn matrix.
Here is my code:
T = 5;
n = 4;
A = randn(T,n);
c = T\(A'*A);
c1 = T\A'*A;
[W, lambda] = eig(c); % columns of W contain eigenvectors
[W1, lambda1] = eig(c1); % columns of W contain eigenvectors
Clearly, c and c1 are the same matrices since I'm only premultiplying the scalar (1/T). However, the eigenvalues in lambda are in different ordering than those in lambda1. Moreover, if I set
T = 50
n = 450
the elements in lambda1 become complex while those in lambda remain real.
I'd very much appreciate if somebody could help me out here and let me know what I'm missing.
Thanks, Peter
0 commentaires
Réponses (1)
Torsten
le 19 Juil 2016
For the problem with complex eigenvalues, see what happens if you set c1=0.5*(c1+c1') before calling "eig".
Best wishes
Torsten.
1 commentaire
Peter
le 19 Juil 2016
Modifié(e) : Peter
le 19 Juil 2016
In this case the eigenvalues become real and the ordering in lambda and lambda1 also coincide.
It seems to be a numerical problem in the computation of c1 that screws up the symmetry of that matrix and, in turn, the eigenvalues. Do you have any idea why this is so? I'm not exactly a numerical wizard, but I guess it's related to building the inverse of T.
Thanks!
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!