Difference between eigs and eig
59 次查看(过去 30 天)
显示 更早的评论
Hello,
I am unable to understand the eigs function. The documentation states that eigs(A,k,sigma) returns 'k' eigen values/vectors of A closest to 'sigma'.
- When I call it for different values of 'k', the returned eigenvalues change considerably. For example, my expectation is that eigs(A,3,0) should share 2 eigenvalues returned by eig(A,2,0)
- Second, the values returned are considerably different from those returned by eig.
Is this behavior expected? I will appreciate if someone could explain.
Thank you.
Best regards
0 个评论
回答(5 个)
Quantum
2014-4-23
1 个评论
Geoff Hayes
2014-4-23
Hi Quantum,
The documentation for eigs states that the input matrix A should be square and sparse, and in the Tips section:
d = eigs(A,k) is not a substitute for
d = eig(full(A))
d = sort(d)
d = d(end-k+1:end)
So it is understood that the two may produce different results.
As for your first question, I agree with you that the there should be two shared eigenvalues when k is increased from 2 to 3. I have observed that for a couple of the examples that I tried. Could you post your example (A matrix) where the eigenvalues change considerably?
Geoff
Andrew Knyazev
2015-5-15
Is this behavior expected?
- Yes. Eigs uses a tricky method that may give the results you describe, especially for funny matrices.
0 个评论
Juan Garcia
2015-12-8
As far as I know the difference is because eigs use iterative methods to calculate ther eigenmodes, being ther error bigger in the last calculated eigenmodes. If you request more eigenmodes, you should check that only the last differ. Regards
0 个评论
Manish Waykole
2016-4-11
If you have checked this then let it pass. I had faced a similar problem, if you are passing the following syntax eigs(A) then it gives largest 6 eigen values by default. To get more of the eigen values use eigs(A,9) *here 9 is an example denoting that you need 9 eigen values arranged in descendin order.
Note: In descending order. All the values are in descending order on contrary to eig command which acc. to my knowledge gives eigen values in ascending order
I have a question, what kind of eigen vector is obtained. I have a input of the form eigs(A,B,5,'sm') implying that I need 5 smallest eigen values. Here as far as I can see the eigen vector generated also has 5 rows so it is incomplete. Incomplete in the sense that I need it(whole of it almost 16 eigen values are present) in my further calculations.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!