Why doesnt chol work for hermitian positive semi-definite matrix?

조회 수: 25 (최근 30일)
Hello,
I am trying to perform factorization of form A = R'*R using matlab function 'chol' but A is not positive definite, rather its hermitian positive semi-definite. As per theory from https://en.wikipedia.org/wiki/Hermitian_matrix , I should be able to perform factorization but matlab expects A to be positive definite matrix. Is there an alternative function in matlab?
Thanks,
  댓글 수: 3
Nikhil Challa
Nikhil Challa 2022년 9월 25일
@Geoff Hayes , the https://en.wikipedia.org/wiki/Cholesky_decomposition link also talks about decomposition for hermitian positive semi-definite matrix except the solution may not be unique. Matlab has lot of functions that provide solution even for non-unique cases, so I would expect matlab to do the same for 'chol' function also.
Let me know if my understanding is incorrect.

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

채택된 답변

Pravarthana P
Pravarthana P 2022년 9월 28일
Hi Nikil Challa,
I understand that you are trying to perform factorization using “chol” function and are facing an issue with positive semi-definite matrix.
The “chol” function expects a symmetric positive definite matrix as input as mentioned in the documentation link.
The following can likely be a workaround to factorize positive semi-definite matrix:
  1. Compute the LDL decomposition: A lower-triangular matrix L, a block-diagonal matrix D (1-by-1 and 2-by-2 blocks), and a permutation matrix P, such that A is P*L*D*L'*P' :
[L, D, P] = ldl(A);
2.Compute the eigenvalue decomposition, set its negative eigenvalues to zero, and use QR to get two triangular factors for this modified matrix:
[U, d] = eig(A, 'vector'); % A == U*diag(d)*U'
d(d < 0) = 0; % Set negative eigenvalues of A to zero
[~, R] = qr(diag(sqrt(d))*U');
% Q*R == sqrt(D)*U', so A == U*diag(d)*U'== R'*Q'*Q*R == R'*R
% In this case, check that d(d<0) are all nearly zero.
3.Add a small number to A’s diagonal before calling Cholesky:
R=chol(A+1e-13*eye(size(A)));
To know more information on why the “chol” function cannot be used to factorize positive semi-definite matrix, you can refer to the link.
I hope this information helps you.

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by