Why doesnt chol work for hermitian positive semi-definite matrix?
27 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nikhil Challa
le 25 Sep 2022
Réponse apportée : Pravarthana P
le 28 Sep 2022
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,
Réponse acceptée
Pravarthana P
le 28 Sep 2022
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:
- 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!