Cholesky decomposition error when matrix is regularized.
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jorey
am 3 Jan. 2017
Kommentiert: Jorey
am 4 Jan. 2017
I want to perform cholesky facterization to a covariance matrix using chol. As my data matrix has more columns than rows, thus the covariance matrix should be probably positive semi-definite. I added a regularized term to the diagonal of covariance matrix to make sure that it is positive definite, which should be safely facterized by chol. However, the error "Matrix must be positive definite" still occurs. What's the point if I want to use a regularization parameter to make the covariance matrix suitable for using chol?
My regularization term is 0.01*eye(c), where c is the size of covariance matrix.
Thanks.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 3 Jan. 2017
Your covariance matrix probably is not exactly symmetric. Consider forcing it to be symmetric by using
A = (A+A.')/2;
7 Kommentare
Walter Roberson
am 3 Jan. 2017
-min(eig(C), 0) to get to at least 0
However, there might still be round-off problems with this.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!