This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Negative Eigenvalues From Diagonalized Covariance Matrix

Tags: None
(comma "," separated)
seanl
Registered Member
Posts
6
Karma
0
Hi Eigen Community,

I have computed a covariance matrix from some data and have diagonalized it to obtain the eigenvalues. From what I understand, covariance matrices should be positive-semidefinite and should have non-negative eigenvalues. However, I found that the smallest eigenvalue was reported to be -7.43002e-17. While I know that this value is close to zero, is there an explanation as to why I am getting a negative number? Should I just take the absolute value instead?

If it matters, I am using the "SelfAdjointEigenSolver" to diagonalize the covariance matrix. Maybe a different function would be better or more reliable?

Thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
This is because of finite precision errors. -7.43002e-17 should likely be considered as 0. Instead of the absolute value I'd use the max with 0.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]