# Cholesky Decomposition of a Sparse Symmetric Positive Semidefinite (SPSD) Singular Matrix

**URL:** <https://discourse.julialang.org/t/cholesky-decomposition-of-a-sparse-symmetric-positive-semidefinite-spsd-singular-matrix/119682>\
**Category:** Numerics\
**Tags:** linearalgebra, numerics, sparse, factorization\
**Created:** [September 21, 2024, 2:57pm UTC](https://discourse.julialang.org/t/cholesky-decomposition-of-a-sparse-symmetric-positive-semidefinite-spsd-singular-matrix/119682 "2024-09-21T14:57:40Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 22, 2024, 6:23pm UTC](https://discourse.julialang.org/t/cholesky-decomposition-of-a-sparse-symmetric-positive-semidefinite-spsd-singular-matrix/119682/8 "2024-09-22T18:23:33Z")

</div>

> [@RoyiAvital](#):
>
> How would you handle the decomposition of rank deficient SPSD sparse matrix?  
> If I understand correctly, pivoting is not an option?  
> Does it make sense only use `check = false`?

As I said in the original thread, the problem is that roundoff errors usually make it impossible to distinguish semidefinite matrices from slightly indefinite matrices. I looked through the CHOLMOD documentation and I don’t see any option to specify a tolerance to ignore slightly negative pivots. Pivoting doesn’t help if it’s indefinite. So the problem is that even with `check=false` the Cholesky factorization might simply get stuck partway through.

You could try an L D L^T factorization instead. But even if you have a factorization that succeeds, I wouldn’t use the normal equations in an ill-conditioned case: as soon as you form A^T A you have lost too many digits.

---

_[View the full topic](https://discourse.julialang.org/t/cholesky-decomposition-of-a-sparse-symmetric-positive-semidefinite-spsd-singular-matrix/119682)._
