Search code examples
c++eigencovariance-matrix

Does Eigen have solution for repair non-positive defined covariance matrix


Does Eigen contains an algorithm for solving nearest correlation matrix problems?


Solution

  • You can use the SelfAdjointEigenSolver to decompose your non-positive definite matrix, edit the negative eigenvalues to something slightly positive and (manually) re-compose the matrix.