[Math] Is non semi-positive definite matrix invertible

covarianceinversematricespositive definite

I'm aware that positive definite matrix is invertible. I've also read that a matrix is semi-positive definite if and only if the matrix is invertible.

Then, is my matrix invertible when it is not positive definite, nor not semi-positive definite?

One more question – I've encountered a situation in which I have non-positive definite matrix due to floating point precision issues: some of my elements were $-1.623$e-16.

I am computing a covariance matrix, so I know that my matrix should theoretically be semi-positive definite. Therefore, $-1.623$e-16 is negative due to rounding errors. In a situation like this, is it safe to replace it with $0$?

Thanks,

Best Answer

If your question is a mathematical question (and not a computing one), then yes a non positive semidefinite matrix can be invertible.

For example, if a $n\times n$ real matrix has $n$ eigenvalues and none of which is zero, then this matrix is invertible. If these eigenvalues are all negative, then the matrix is negative definite and so, in particular, not positive semidefinite. And if some eigenvalues are positive and the remaining eigenvalues are negative, then the matrix is neither positive definite nor negative definite nor positive semidefinite nor negative semidefinite; nonetheless, the matrix is still invertible.