Learn R Programming

loo (version 2.8.0)

Efficient Leave-One-Out Cross-Validation and WAIC for Bayesian Models

Description

Efficient approximate leave-one-out cross-validation (LOO) for Bayesian models fit using Markov chain Monte Carlo, as described in Vehtari, Gelman, and Gabry (2017) . The approximation uses Pareto smoothed importance sampling (PSIS), a new procedure for regularizing importance weights. As a byproduct of the calculations, we also obtain approximate standard errors for estimated predictive errors and for the comparison of predictive errors between models. The package also provides methods for using stacking and other model weighting techniques to average Bayesian predictive distributions.

Copy Link

Version

Install

install.packages('loo')

Monthly Downloads

47,605

Version

2.8.0

License

GPL (>= 3)

Maintainer

Last Published

July 3rd, 2024

Functions in loo (2.8.0)

loo-package

Efficient LOO-CV and WAIC for Bayesian models
kfold-generic

Generic function for K-fold cross-validation for developers
loo-datasets

Datasets for loo examples and vignettes
importance_sampling

A parent class for different importance sampling methods.
gpdfit

Estimate parameters of the Generalized Pareto distribution
loo

Efficient approximate leave-one-out cross-validation (LOO)
loo-glossary

LOO package glossary
loo_approximate_posterior

Efficient approximate leave-one-out cross-validation (LOO) for posterior approximations
kfold-helpers

Helper functions for K-fold cross-validation
find_model_names

Find the model names associated with "loo" objects
loo_predictive_metric

Estimate leave-one-out predictive performance..
old-extractors

Extractor methods
nobs.psis_loo_ss

The number of observations in a psis_loo_ss object.
loo_moment_match_split

Split moment matching for efficient approximate leave-one-out cross-validation (LOO)
loo_moment_match

Moment matching for efficient approximate leave-one-out cross-validation (LOO)
loo_subsample

Efficient approximate leave-one-out cross-validation (LOO) using subsampling, so that less costly and more approximate computation is made for all LOO-fold, and more costly and accurate computations are made only for m<N LOO-folds.
obs_idx

Get observation indices used in subsampling
loo_compare

Model comparison
loo_model_weights

Model averaging/weighting via stacking or pseudo-BMA weighting
nlist

Named lists
parallel_psis_list

Parallel psis list computations
print.loo

Print methods
pointwise

Convenience function for extracting pointwise estimates
relative_eff

Convenience function for computing relative efficiencies
pareto-k-diagnostic

Diagnostics for Pareto smoothed importance sampling (PSIS)
psis_approximate_posterior

Diagnostics for Laplace and ADVI approximations and Laplace-loo and ADVI-loo
psislw

Pareto smoothed importance sampling (deprecated, old version)
print_dims

Print dimensions of log-likelihood or log-weights matrix
psis

Pareto smoothed importance sampling (PSIS)
waic

Widely applicable information criterion (WAIC)
tis

Truncated importance sampling (TIS)
update.psis_loo_ss

Update psis_loo_ss objects
weights.importance_sampling

Extract importance sampling weights
sis

Standard importance sampling (SIS)
compare

Model comparison (deprecated, old version)
crps

Continuously ranked probability score
ap_psis

Pareto smoothed importance sampling (PSIS) using approximate posteriors
E_loo

Compute weighted expectations
.ndraws

The number of posterior draws in a draws object.
.compute_point_estimate

Compute a point estimate from a draws object
.thin_draws

Thin a draws object
extract_log_lik

Extract pointwise log-likelihood from a Stan model
example_loglik_array

Objects to use in examples and tests
elpd

Generic (expected) log-predictive density