Getting Started

These vignettes demonstrate how to use the loo package to perform approximate leave-one-out cross-validation or exact K-fold cross-validation for Bayesian models fit using MCMC, compare models on estimated predictive performance on new data, and weight models for averaging predictive distributions.

Using the loo package (version >= 2.0.0)
Bayesian Stacking and Pseudo-BMA weights using the loo package
Writing Stan programs for use with the loo package
Holdout validation and K-fold cross-validation of Stan programs with the loo package

Additional topics

These vignettes demonstrate how to use the loo package for more complicated scenarios including models with non-factorized likelihoods, forecasting models, models fit to very large datasets, and more.

Leave-one-out cross-validation for non-factorized models
Approximate leave-future-out cross-validation for Bayesian time series models
Using Leave-one-out cross-validation for large data
Avoiding model refits in leave-one-out cross-validation with moment matching

Frequently asked questions

Answers to frequently asked questions about cross-validation and the loo package.

Cross-validation FAQ