This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can I use LDLT to check whether a PSD matrix is singular?

Tags: None
(comma "," separated)
simbaforrest
Registered Member
Posts
2
Karma
0
Hi All,

I'm solving the Ax=b problem (A is mxn where m>>n) by solving the normal equation Bx=c (B=A'A, c=A'b). Sometimes rank(A) can be smaller than n so the B matrix will be singular (but still positive semidefinite). My question is: can I use LDLT to check whether B is singular or not as follows
Code: Select all
Eigen::VectorXd D = B.ldlt().vectorD().cwiseAbs();
bool is_B_singular = D.maxCoeff() > (D.minCoeff() * 1e8);


The Eigen documentation of LDLT says that:
Remember that Cholesky decompositions are not rank-revealing. Also, do not use a Cholesky decomposition to determine whether a system of equations has a solution.

This makes me a bit confused about whether I can do this checking reliably or not.

Best,
Chen
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Such a test is indeed not reliable, it will only warn you that the problem might not be reliably addressed by a LDLT decomposition and that using a rank revealing QR of SVD might be safer.
simbaforrest
Registered Member
Posts
2
Karma
0
ggael wrote:Such a test is indeed not reliable, it will only warn you that the problem might not be reliably addressed by a LDLT decomposition and that using a rank revealing QR of SVD might be safer.


Thanks a lot! I was using ColPivHouseholderQR but I thought LDLT should be much faster according to the Eigen documentation. But when I test it today, it seems that LDLT is not necessarily faster than ColPivHouseholderQR in my case, so I might eventually pick to use ColPivHouseholderQR.

Is it because my B matrix is small (16x16) so ColPivHouseholderQR and LDLT do not have much speed difference?


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient