Registered Member
|
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! |
Moderator
|
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.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]