eigs function: incorrect eigenvectors
조회 수: 4 (최근 30일)
이전 댓글 표시
I am using eigs to find largest 330 eigenvalues, the eigenvalues converges and found pretty match with eig (full (my matrix)), But the eigen vectors didn't match well, it is showing completely new eigen vector. What is the problem? here is my matrix, please?
my matrix= sparse size: 456 x 456
here is the code: [V D]=eigs(M4,330,'la');
for full matrix,
[V1 D1]=eig(full(M4));
thanks in advance.
댓글 수: 0
답변 (3개)
Ced
2014년 10월 22일
편집: Ced
2014년 10월 22일
One thing to notice is that eigs orders the eigenvalues (and vectors) in descending order, while eig has them in ascending order.
Then, I believe there are simply numerical problems here. If you check e.g.
norm(M4*V1(:,1)-D1(1,1)*V1(:,1))
, which should be zero by definition, is not.
If you try the code you have above for e.g. M4 = randn(5,5), you will see that eig and eigs return both the same eigenvalues and eigenvectors. The error in direction is of magnitude 1e-15, which is numerically zero, but is huge if you have eigenvalues of the magnitude of 1e30, as is the case with M4.
Cheers
Mark Stone
2015년 5월 15일
편집: Mark Stone
2015년 5월 15일
If you like your eig, you can keep your eig. No one will be forced to switch their eigenvalue/vector provider to eigs if they're happy with their eig.
As I wrote in another thread:
eigs does not always converge, even if maximum number of iterations is significantly increased and/or solution tolerance decreased. Furthermore, it is random, i.e., non-repeatable, even on the exact same matrix unless random numbers are controlled to be the same at invocation.
eig is much more robust than eigs, and execution time of eigs is more unpredictable than eig, and can be longer. I've run nonlinear optimization algorithms in which eigenvalues (maybe the most extreme 1 or 2) appear in the objective function and/or constraints - even though the algorithm might start and finish (if it ever gets there) in a nice neighborhood in which eigs works just fine, the algorithm might have to go through some unseemly areas along the way, and eigs has a propensity for getting into trouble somewhere and muck everything up. I've rendered eigs to the ash heap of history after wasting too much time dealing with its nonsense. Someone should shoot it and put it out of the misery it causes.
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!