Hi,
Great job, clean and neat.
However, I am running into some problems when using nearcorr. The matrices it produces are semidefinite positive to floating error precision.
For what I see, the negative eigenvalues are set to zero, but a negative zero!
Then, when I attempt to do a cholesky decomposition it fails, for the eigenvalues are not strictly positive.
To fix this problem I tried using an SVD decomposition and forcing the eigenvalues close to zero to be exactly zero, but then building back the matrix with U and VT did not yield a positive matrix either.
Any modifications we could make to the code to ensure the coming matrix has numerically all the eigenvalues to positive?
Hi,
Great job, clean and neat.
However, I am running into some problems when using
nearcorr. The matrices it produces are semidefinite positive to floating error precision.For what I see, the negative eigenvalues are set to zero, but a negative zero!
Then, when I attempt to do a cholesky decomposition it fails, for the eigenvalues are not strictly positive.
To fix this problem I tried using an SVD decomposition and forcing the eigenvalues close to zero to be exactly zero, but then building back the matrix with U and VT did not yield a positive matrix either.
Any modifications we could make to the code to ensure the coming matrix has numerically all the eigenvalues to positive?