Can a positive definite matrix have complex eigenvalues?

6.3k Views Asked by At

We know that a positive definite matrix has positive eigenvalues. I wanted to know if there is any result that shows whether a positive definite matrix can have complex eigenvalues. I am currently calculating a covariance matrix which has real entries and is symmetric. In order to find the accuracy of the calculation, I tried to find the eigenvalues of the matrix and then generate c-code using MATLAB coder to use in my Kalman filter equations. However, when the coder gives error that the eigenvalues are complex. It is to be noted that the first two eigenvalues of the matrix are close two zero.

1

There are 1 best solutions below

0
On BEST ANSWER

As you say in the comments, your matrix is a covariance matrix. It should therefore have real, non-negative eigenvalues. Any imaginary component to your eigenvalues is likely due to numerical error. If this is the case, try just taking the real part of the eigenvalues (you should find that the imaginary parts are close to $0$ anyway).