LDLT v LLT for cholesky decompose

429 views
Skip to first unread message

Robert Trangucci

unread,
Mar 17, 2015, 11:11:11 AM3/17/15
to Stan
@bgoodri it seems like a lot of our multivariate code uses stan::math::ldlt_factor rather than LLT. Is there any reason to use LLT for cholesky rather than LDLT? It'd be good for consistency.

We have a function to check a Stan::math::ldlt_factor for positive definite ness called check_ldlt_factor in math/prim/mat/err. If we used ldlt internally we wouldn't need a check_pos_definite function to take an Eigen::LLT type.

Rob

Ben Goodrich

unread,
Mar 17, 2015, 11:30:00 AM3/17/15
to stan...@googlegroups.com
LDLT in Eigen is not so good for Stan, except for checking positive definiteness and solving systems of equations. Eigen does pivoting so it is really a

Sigma = PLDL'P'

decomposition. Also, the pivoting is discontinuous, so it is not great for HMC.

Ben

Michael Betancourt

unread,
Mar 17, 2015, 11:50:16 AM3/17/15
to stan...@googlegroups.com
Autodiffing through LDLT is a bad idea, but it wouldn’t necessarily
be bad given analytic derivatives.  My understanding is that LDLT
is more stable than LLT but also slower.

--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Goodrich

unread,
Mar 17, 2015, 11:57:43 AM3/17/15
to stan...@googlegroups.com
We could, in the future, have a decomposition that returned P * L and D. But I think we should leave cholesky_decompose as is because it returns an actual lower-triangular matrix. All these matrix decompositions have analytic derivatives, but they are really tedious. The first-order derivatives of LDLT involve inverses of principal submatrices of the original matrix.

Ben
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages