Eigenvalue computation for large matrix

조회 수: 11 (최근 30일)
Peter
Peter 2016년 7월 19일
편집: Peter 2016년 7월 19일
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

답변 (1개)

Torsten
Torsten 2016년 7월 19일
For the problem with complex eigenvalues, see what happens if you set c1=0.5*(c1+c1') before calling "eig".
Best wishes
Torsten.
  댓글 수: 1
Peter
Peter 2016년 7월 19일
편집: Peter 2016년 7월 19일
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!

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

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by