You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Efficient approximate leave-one-out cross-validation for fitted Bayesian models
loo is an R package that allows users to compute efficient approximate
leave-one-out cross-validation for fitted Bayesian models, as well as model
weights that can be used to average predictive distributions.
The loo package package implements the fast and stable computations for
approximate LOO-CV
Vehtari, A., Gelman, A., and Gabry, J. (2017). Practical Bayesian model
evaluation using leave-one-out cross-validation and WAIC.
Statistics and Computing. 27(5): 1413-1432.
Journal,
arXiv preprint
Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024).
Pareto smoothed importance sampling. Journal of Machine Learning Research,
25(72): 1-58.
Journal,
arXiv preprint
and computes model weights as described in
Yao, Y., Vehtari, A., Simpson, D., and Gelman, A. (2018). Using
stacking to average Bayesian predictive distributions. Bayesian Analysis
13(3): 917-1007.
Journal,
arXiv preprint
From existing posterior simulation draws, we compute approximate LOO-CV using
Pareto smoothed importance sampling (PSIS), a new procedure for regularizing
importance weights. As a byproduct of our calculations, we also obtain
approximate standard errors for estimated predictive errors and for comparing
predictive errors between two models. We recommend PSIS-LOO-CV instead of WAIC,
because PSIS provides useful diagnostics and effective sample size and Monte
Carlo standard error estimates.
We do not recommend setting build_vignettes=TRUE when installing from GitHub
because some of the vignettes take a long time to build and are always available
online at mc-stan.org/loo/articles/.
Python and Matlab/Octave Code
Corresponding Python and Matlab/Octave code can be found at the
avehtari/PSIS repository.
Contributing to loo
Contributions are welcome! loo is under active development and pull requests are always appreciated. Bugs, ideas (with or without implementations) should be noted by opening an issue. Please read CONTRIBUTING.md for further details.
License
The code is distributed under the GPL 3 license. The documentation is distributed under the CC BY 4.0 license.
About
loo R package for approximate leave-one-out cross-validation (LOO-CV) and Pareto smoothed importance sampling (PSIS)