Why are eigenvector matrices computed by matlab not idempotent

As far as I know, eigenvector matricies should be idempotent. The eigendecompsotion in matlab however, fails to satisfy this.
Here is an example with my comments:
numel=3;
a = rand(numel);a2=a*a';%gen symmetric matrix
[G,L] = eig(a); %eigendecomposiaion
%i know this is what matlab is solving for
norm(a*G-G*L)%and it does, this quantity is close to zero
%eigenvector matricies should be idempotent
norm(G'*G-eye(numel))
norm(G*G'-eye(numel))
%neither of these are close to zero... that is troubling
%Also, if G was idempotent, these would be zero
norm(a-(G*L*G'))
norm(a-(G'*L*G)) %i checked this too b/c i thought i made a mistake with the transpose
%why should this be true?
%AG=GL -- what matlab solves for
%A=GL*inv(G)
%inv(G)=G' for idempotent matrices, so A=GL*G'
Can anyone explain what is going on here? I have an application where I am trying to orthoganalize a set of equations using an eigen decomposition, and the resulting matrix is not exactly diagonal.
ex. in my example, G'*a*G should be diagonal (it should equal L), but it is not
Cheating, and using the inverse, we get that (G\a)*G is 'almost' diagonal
Thanks,
Marco

 채택된 답변

Christine Tobler
Christine Tobler 2019년 12월 12일
편집: Christine Tobler 2019년 12월 12일

2 개 추천

Hi Marco,
You seem to be confusing two terms: A matrix M is idempotent if ; it's orthogonal if , which is what you are testing for in your code.
There is an orthogonal basis of eigenvectors for a matrix A if it's symmetric. In your code you're constructing a symmetric matrix, a2, but the matrix a which you're passing to eig is not symmetric.
If A is symmetric, and has two eigenpairs , , with c not equal to c, then x and y must be orthogonal:
Since c and d are not equal, this implies that must be equal to zero, meaning that x and y are orthogonal.

댓글 수: 3

Thank you. After reading your post, I also realized two other things:
1) I had a repeated eigenvalue in my application (for an actually symmetric matrix)
2) I should be using SVD instead of EIG
ex.
ts=(sighalfsqrt\Sigmae)/(sighalfsqrt);
[a,b,c]=svd(ts);
rotcov=((a')/sighalfsqrt)*(Sigmae/sighalfsqrt)*a
When I use SVD, even with the repeated eigenvalue, rotcov is diagonal
Thanks again,
Marco
Even with repeated eigenvalues, EIG should return orthogonal eigenvectors for a symmetric input matrix. The problem is that it checks for exact symmetry to decide if this orthogonalization is necessary, and often matrices are just close to symmetrical. You might want to compute
norm(A - A')
it might show some round-off error. If A is close to symmetric, calling eig((A + A')/2) will make sure the symmetric method is used and the eigenvector matrix is orthogonal.
eig((A + A')/2) worked, thank you!
Marco

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Linear Algebra에 대해 자세히 알아보기

제품

릴리스

R2016b

질문:

2019년 12월 12일

댓글:

2019년 12월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by