Why is the inverse of a symmetric matrix not symmetric?!

조회 수: 9 (최근 30일)
Ted
Ted 2013년 5월 8일
Hi all, As far as I know, the inverse of symmetric matrix is always symmetric. However, I have a symmetric covariance matrix, call it C, and when I invert it (below), the solution, invC, is not symmetric!
>> invC = inv(C); % (inefficient I know, but it should still work...)
>> isequal(invC,invC')
ans = 0
Has anyone had this issue? Can this be due to rounding errors? My matrix is 1810x1810 with many entries like 0.0055, etc.
Thanks in advance!

채택된 답변

Roger Stafford
Roger Stafford 2013년 5월 8일
Yes, it's roundoff error. Instead of 'isequal' which demands exact equality, try displaying the difference invC-invC' to see if the differences fall within the range of what you would regard as reasonable round off errors. With a matrix which is close to being singular these can be surprisingly large sometimes.
  댓글 수: 2
Ted
Ted 2013년 5월 10일
Thanks for the tip.
The errors were small. I've now forced my "inverse" to be symmetric:
>> invCtrans = invC';
>> invC = triu(invC) + tril(invCtrans) - diag(diag(invC);
What I'm really trying to do now is use the chol() command for cholesky factorization. I know I need a symmetric positive definite matrix (spd), and I've checked by using eigs(invC,10,0), which tells me the 10 smallest eigenvalues are all positive. I'm still getting the following though:
>> U = chol(invC)
error using chol: matrix must be positive definite
... Any thoughts? Doesn't my eigenvalues test show that invC is spd?
Ted
Ted 2013년 5월 10일
Never mind. I was getting the 10 eigenvalues with smallest magnitude, rather than the "most-negative."

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

추가 답변 (1개)

Youssef  Khmou
Youssef Khmou 2013년 5월 8일
편집: Youssef Khmou 2013년 5월 8일
hi,
Try to use a tolerance criterion :
C=symdec(100,100);
C=C/max(C(:))
I1=inv(C);
I2=inv(C');
norm(I1-I2) % its not zeros but saturated to zero (1e-n , n>20 )
  댓글 수: 1
Ted
Ted 2013년 5월 10일
The "symdec" command doesn't help me. I don't have the Robust Control Toolbox...

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

카테고리

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