eigs function: incorrect eigenvectors

조회 수: 10 (최근 30일)
Gaffar
Gaffar 2014년 10월 22일
댓글: Gaffar 2015년 5월 15일
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.

답변 (3개)

Ced
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
  댓글 수: 1
Gaffar
Gaffar 2014년 10월 22일
Thanks for the reply. I chack the norm of error, its over 100% in some case and also i know they order in decending or ascending order. I chose particular one test on it. its not good.

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


Andrew Knyazev
Andrew Knyazev 2015년 5월 15일
This is normal for eigs. If you are happy with eig, just stay with it.
  댓글 수: 1
Gaffar
Gaffar 2015년 5월 15일
Thanks for the reply. I am happy with it and staying with it. Thanks again.

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


Mark Stone
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.
  댓글 수: 1
Gaffar
Gaffar 2015년 5월 15일
ha ha, thanks for your reply. Its really funny though!

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

카테고리

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