stan-dev / stan

Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
https://mc-stan.org
BSD 3-Clause "New" or "Revised" License
2.61k stars 369 forks source link

Replacing `llt` with `ldlt` decomposition in the Laplace approximation #3156

Open spinkney opened 2 years ago

spinkney commented 2 years ago

Summary:

The Laplace approximation code at https://github.com/stan-dev/stan/blob/a3ee52eee6a294638445f2db5fed37214fae3142/src/stan/services/optimize/laplace_sample.hpp#L83 uses a Cholesky decomposition. In other parts of Stan's code base we use the ldlt decomposition from Eigen due to it's superior numerical stability (at the expense of being slower).

Description:

Replace the llt() with ldlt() for slower but more numerically stable code.

Current Version:

v2.31.0