Skip to content

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

77packages dependsuggested by 45
7.5Mdownloads / year
92.9%test coverage
13/13flavors OK

Overview

About

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) doi:10.1007/s11222-016-9696-4. 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.

Changes in 2.10.1
  • Revert behavior of internal psis_smooth_tail() function that led to several

failing tests not caught by CRAN reverse dependency checks. This change should

not directly affect individual users. by @VisruthSK in #381

  • print.compare.loo() regains a simplify argument for showing the full

comparison table with simplify = FALSE by @florence-bockting in #383.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 4.6 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-25
  • ERROR12 OK, 1 ERROR2026-06-27
  • OK14 OK2026-04-11
Show 4 earlier changesHide 4 earlier changes
  • ERROR13 OK, 1 ERROR2026-04-09
  • OK14 OK2026-03-28
  • ERROR13 OK, 1 ERROR2026-03-21
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 2.10.1
README· In the repository, left out of the releaseVignettesYes · 9 · dynamicNEWSYes · 100% structured · mentions 2.10.1Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
44 (8 internal)includes a package overview page
Examples that run
65%13 run in a plain check · 2 only when donttest examples are enabled (R CMD check --as-cran) · 3 never run · 2 hold no code
Exported functions with examples
59%
Documented parameters
98%
Return-value docs
94%
Help pages citing references
48%

Downloads

7.5M
CRAN downloads in the past year
Rank #102 · ~20.7K/day · ~628.4K/mo
Daily download trend is not available in this view yet.
468.1K30 days
1.8M90 days
7.5M1 year
Compare downloads with other packages →
Also on18.7K r2u190 autocran24.5K conda_forge1K c2d4u

Repository

159Stars
37Forks
42Open issues
13Open PRs
23Releases
1,642Commits
27Commit identities
cross-validationstanr-packagebayesian-data-analysisinformation-criterionbayesian-methodsmodel-comparisonbayesian
1,642 commits · Last activity 2026-10-21 · +1.3% stars, 30d · Default branch at 2.10.1.9000, ahead of CRAN 2.10.1 (checked 2026-10-18)
Responsiveness
How these are sampled
PRs merged (all time)
90%
Median days to close, 50 most recently updated closed issues
10
Median days to close, 50 most recently updated closed PRs
1

Stars over time

2025-09-01 · 1522026-10-01 · 159
PracticesBeta

14 development-tooling and community-health practices detected across 8 families in the upstream repository

Checks run against github.com/stan-dev/loo on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (3)
Contributing guideFunding

Funding links: GitHub Sponsors, mc-stan.org

The repository owner accepts GitHub Sponsors

Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-14 · The repository has a site deploy workflow

pkgdown site last built 2026-07-24

Coverage (1)
Coverage reporting
Show all practicesHide 4 practices
Reproducibility and dev environment (1)
data-raw/
Automation and maintenance (1)
Dependabot
Lint, format, editor (1)
RStudio project
Git structural (2)
.gitattributesblame-ignore revs
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
13 external dependencies (excludes base and recommended)

Installing loo adds 19 packages (11 with compiled code, 5.2 MB of source tarballs). Heaviest: vctrs 1.0 MB, rlang 766 KB, cli 629 KB.

Depends (1)
R >= 3.5
LinkingTo (0)
none
Enhances (0)
none

Datasets

People & History

People (13)
Maintainer since 0.1.0 (2015), Author
Author · added in 2.1.0
Author · added in 2.8.0
Author · added in 2.3.0
Author · added in 2.0.0
Contributor · added in 2.10.0
Contributor · added in 0.1.3
Contributor · added in 2.6.0
Contributor · added in 2.4.0
Contributor · added in 0.1.2
Contributor · added in 2.9.0
Listed in earlier versions (1)
no longer listed · 2.1.0 to 2.7.0
Releases (23)

Pick two releases to compare their code metrics.

  • 2.10.1Latest
    record
    2026-07-24 · current release · diff ↗
  • 2.10.0
    record
    2026-06-26 · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 2.9.0
    record
    2025-12-23 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • 2.8.0
    record
    2024-07-03 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • 2.7.0
    record
    2024-02-25 · diff ↗ ·
    added 1 export
    pointwise
  • R
    R 4.3.0 released · 2023-04-21
  • 2.6.0
    record
    2023-03-31 · diff ↗ ·
    added 5 exports
    crps, loo_crps, loo_predictive_metric, loo_scrps, scrps
  • R
    R 4.2.0 released · 2022-04-22
  • 2.5.1
    record
    2022-03-24 · diff ↗
  • 2.5.0
    record
    2022-03-16 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 2.4.1
    record
    2020-12-09 · diff ↗
  • 2.4.0
    record
    2020-12-05 · diff ↗ ·
    added 1 export
    elpd
Show 19 earlier eventsHide 19 earlier events
  • 2.3.1
    record
    2020-07-15 · diff ↗
  • 2.3.0
    record
    2020-07-07 · diff ↗ ·
    added 3 exports
    loo_moment_match, loo_moment_match.default, pareto_k_influence_values
  • R
    R 4.0.0 released · 2020-04-24
  • 2.2.0
    record
    2019-12-19 · diff ↗ ·
    removed 1 export
    weights.psis
    added 15 exports
    .compute_point_estimate, .ndraws, .thin_draws, is.sis, is.tis, loo_approximate_posterior, loo_approximate_posterior.array, loo_approximate_posterior.function, loo_approximate_posterior.matrix, loo_subsample, loo_subsample.function, obs_idx, sis, tis, weights.importance_sampling
  • R
    R 3.6.0 released · 2019-04-26
  • 2.1.0
    record
    2019-03-13 · diff ↗ ·
    removed 1 export
    kfold_split_balanced
    added 9 exports
    find_model_names, is.kfold, is.loo, is.psis, is.psis_loo, is.waic, kfold, kfold_split_grouped, loo_compare
  • R
    R 3.5.0 released · 2018-04-23
  • 2.0.0
    record
    2018-04-11 · diff ↗ ·
    added 19 exports
    example_loglik_array, example_loglik_matrix, kfold_split_balanced, kfold_split_random, kfold_split_stratified, loo.array, loo_i, loo_model_weights, loo_model_weights.default, mcse_loo, pareto_k_values, print_dims, pseudobma_weights, psis, psis_n_eff_values, relative_eff, stacking_weights, waic.array, weights.psis
  • R
    R 3.4.0 released · 2017-04-21
  • 1.1.0
    record
    2017-03-27 · diff ↗ ·
    added 1 export
    E_loo
  • 1.0.0
    record
    2016-12-16 · diff ↗ ·
    added 2 exports
    pareto_k_ids, pareto_k_table
  • R
    R 3.3.0 released · 2016-05-03
  • 0.1.6
    record
    2016-03-23 · diff ↗
  • 0.1.5
    record
    2016-02-12 · diff ↗
  • 0.1.4
    record
    2015-12-10 · diff ↗
  • 0.1.3
    record
    2015-09-18 · diff ↗ ·
    removed 3 exports
    loo_and_waic, loo_and_waic_diff, psisloo
    added 4 exports
    loo.function, loo.matrix, waic.function, waic.matrix
  • 0.1.2
    record
    2015-07-17 · diff ↗ ·
    removed 2 exports
    vgisloo, vgislw
    added 6 exports
    compare, loo, nlist, psisloo, psislw, waic
  • 0.1.0
    record
    2015-06-26
  • R
    R 3.2.0 released · 2015-04-16

Package metadata

First published
2015-06-26
Total releases
23 / 11 yrs
License
GPL (>= 3) OSI
Minimum R
≥ 3.5
Bundled data
298 KB / 4 files
Download size
2.7 MB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("loo")

The package provides a citation file that builds its entry when R runs it. Run citation() to see it.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for loo version 2.10.1 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy