Add laplace_latent_solve() and laplace_latent_tol_solve()#3337
Add laplace_latent_solve() and laplace_latent_tol_solve()#3337florence-bockting wants to merge 4 commits into
laplace_latent_solve() and laplace_latent_tol_solve()#3337Conversation
Jenkins Console Log Machine informationNo LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focalCPU: G++: Clang: |
Summary
Fixes #3335
This PR adds the new functions
laplace_latent_solve()andlaplace_latent_tol_solve()which return a tuple containing the posterior mean and Cholesky factor from the Laplace approximation of p(theta | y, phi).Implementation details:
laplace_base_rng()ReturnMeanAndCovCholeskythat returnsmulti_normal_rng()if false (default) andstd::make_tuple(std::move(mean_train), std::move(Sigma_chol));if truecholesky_decompose(Sigma)to computeSigma_chollaplace_latent_solveandlaplace_latent_solve_tollaplace_base_rng<true>(...)Uncertainties:
laplace_latent_solve_tol. In this PR I use currentlylaplace_latent_tol_solveconsistent with the naming used forlaplace_latent_tol_rngTests
laplace_latent_solve_testfor new functionsSide Effects
I am not aware of any.
Release notes
Replace this text with a short note on what will change if this pull request is merged in which case this will be included in the release notes.
Checklist
Copyright holder: Aalto University
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit)make test-headers)make test-math-dependencies)make doxygen)make cpplint)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested