Positive Semi-definite Matrix Problem

on 7 Aug 2013

Adam Wyatt (view profile)

on 31 Mar 2015
Suppose I have a large M by N dense matrix C, which is not full rank, when I do the calculation A=C'*C, matrix A should be a positive semi-definite matrix, but when I check the eigenvalues of matrix A, lots of them are negative values and very close to 0 (which should be exactly equal to zero due to rank).
I think this may due to numerical issue, is there any other way I could make matrix A positive semi-definite?
I tried to do this: [V,D]=eig(A); A=V*abs(D)*V'
it didn't work
Thanks

Alexander

Alexander (view profile)

on 31 Mar 2015
I have not an answer rather another related question: is there more or less stable way to check if the given matrix is positive semidefinite? Shall I check for non-negativity of all eigenvalues of the Hermitian part?
Torsten

Torsten (view profile)

on 31 Mar 2015
A is always positive semidefinite:
x'*A*x=(C*x)'*(C*x) >=0
for all vectors x.
Or did you mean something else ?
Best wishes
Torsten.

Products

Answer by Richard Brown

Richard Brown (view profile)

on 7 Aug 2013

You're just going to have to live with it. Your matrix is PSD to double precision. If you look at the magnitude of the "zero" eigenvalues, they're probably all around 1e-14 or 1e-15. If your code relies on them being positive, you should amend this to test for eigenvalues near zero that may be negative.