Cholesky decomposition error when matrix is regularized.

조회 수: 12 (최근 30일)
Jorey
Jorey 2017년 1월 3일
댓글: Jorey 2017년 1월 4일
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.

채택된 답변

Walter Roberson
Walter Roberson 2017년 1월 3일
Your covariance matrix probably is not exactly symmetric. Consider forcing it to be symmetric by using
A = (A+A.')/2;
  댓글 수: 7
Walter Roberson
Walter Roberson 2017년 1월 3일
-min(eig(C), 0) to get to at least 0
However, there might still be round-off problems with this.
Jorey
Jorey 2017년 1월 4일
Thanks, it works if I used 'lambda' as max(abs(eig(C))), i.e., C+max(abs(eig(C)))*eye(c), where C is my covariance matrix and c is the size of C.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by