accuracy of two methods to solve eignvalues/eignvector problem

3 ビュー (過去 30 日間)
MA
MA 2020 年 4 月 3 日
回答済み: Christine Tobler 2020 年 4 月 3 日
I am trying to solve an eignvalue/eignvector problem related to the multi-class LDA. The equation is inv(Sw)*Sb. I have two solutions:
[E,D]=eig(inv(Sw)*Sb)
or
[E,D]=eig(Sb,Sw);
when I try them, I get different eignvectors and eignvalues in both cases. Am I supposed to get the same results and what is more accurate to use the first way or the second one?

採用された回答

Christine Tobler
Christine Tobler 2020 年 4 月 3 日
The second way is typically more accurate, because it doesn't incur additional round-off error when conputing inv(Sw) and when multiplying this to Sb.
Can you give an example of the eigenvalues and eigenvectors being different? It's to be expected that the order of the eigenvalues changes between two different ways of calling EIG, and the eigenvectors may be scaled in different ways between the two cases. Any other changes would be due to round-off error.
One way to check the accuracy of the combined eigenvectors and eigenvalues is to compute the residual norm:
For [U, D] = eig(A)
norm(A*U - U*D)
For [U, D] = eig(A, B)
norm(A*U - B*U*D)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePHY Components についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by