eigs function: incorrect eigenvectors

7 次查看(过去 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.

类别

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