Skip to content

Nearcorr sets zero eigenvalues with a negative sign #1

Description

@emvalbuena

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions