Learn R Programming

⚠️There's a newer version (2.8.0) of this package.Take me there.

loo (version 2.5.1)

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

54,425

Version

2.5.1

License

GPL (>= 3)

Maintainer

Jonah Gabry

Last Published

March 24th, 2022

Functions in loo (2.5.1)

example_loglik_array

Objects to use in examples and tests
.ndraws

The number of posterior draws in a draws object.
E_loo

Compute weighted expectations
elpd

Generic (expected) log-predictive density
extract_log_lik

Extract pointwise log-likelihood from a Stan model
compare

Model comparison (deprecated, old version)
ap_psis

Pareto smoothed importance sampling (PSIS) using approximate posteriors
find_model_names

Find the model names associated with "loo" objects
.thin_draws

Thin a draws object
gpdfit

Estimate parameters of the Generalized Pareto distribution
loo-glossary

LOO package glossary
loo_subsample

Efficient approximate leave-one-out cross-validation (LOO) using subsampling
importance_sampling

A parent class for different importance sampling methods.
loo_approximate_posterior

Efficient approximate leave-one-out cross-validation (LOO) for posterior approximations
loo-package

Efficient LOO-CV and WAIC for Bayesian models
loo

Efficient approximate leave-one-out cross-validation (LOO)
loo_compare

Model comparison
importance_sampling.array

Importance sampling of array
loo_model_weights

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

Pareto smoothed importance sampling (deprecated, old version)
nobs.psis_loo_ss

The number of observations in a psis_loo_ss object.
importance_sampling.default

Importance sampling (default)
psis_approximate_posterior

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

Get observation indices used in subsampling
nlist

Named lists
relative_eff

Convenience function for computing relative efficiencies
sis

Standard importance sampling (SIS)
kfold-generic

Generic function for K-fold cross-validation for developers
importance_sampling.matrix

Importance sampling of matrices
kfold-helpers

Helper functions for K-fold cross-validation
loo-datasets

Datasets for loo examples and vignettes
.compute_point_estimate

Compute a point estimate from a draws object
psis

Pareto smoothed importance sampling (PSIS)
print_dims

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

Truncated importance sampling (TIS)
update.psis_loo_ss

Update psis_loo_ss objects
loo_moment_match_split

Split moment matching for efficient approximate leave-one-out cross-validation (LOO)
pareto-k-diagnostic

Diagnostics for Pareto smoothed importance sampling (PSIS)
loo_moment_match

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

Widely applicable information criterion (WAIC)
weights.importance_sampling

Extract importance sampling weights
print.loo

Print methods
parallel_psis_list

Parallel psis list computations
old-extractors

Extractor methods