Skip to content

loo

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

v2.9.0 · Dec 22, 2025 · GPL (>= 3)

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) <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.

Downloads

215.7K

Last 30 days

224th

2.9M

Last 90 days

3.8M

Last year

Trend: -78.6% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 27, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 20, 2026
ERROR r-devel-windows-x86_64

tests

Running 'testthat.R' [29s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(loo)
  This is loo version 2.9.0
  - Online documentation and vignettes at mc-stan.org/loo
  - As of v2.0.0 loo defaults to 1 core but we recommen
...[truncated]...
       └─base::lapply(...)
   15.               └─testthat (local) FUN(X[[i]], ...)
   16.                 └─private$handle_error(msg, i)
   17.                   └─cli::cli_abort(...)
   18.                     └─rlang::abort(...)
  Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (85)

Dependency Network

Dependencies Reverse dependencies checkmate matrixStats posterior (>= 1.5.0) TriDimRegression bistablehistory spsurv BAMBI BayesERtools BayesGrowth BayesianFitForecast CLRtools CRTspat EBcoBART FlexReg GPTCM HeckmanStan LMMELSM MetaStan +70 more reverse deps loo

Version History

new 2.9.0 Mar 10, 2026
updated 2.9.0 ← 2.8.0 diff Dec 22, 2025
updated 2.8.0 ← 2.7.0 diff Jul 2, 2024
updated 2.7.0 ← 2.6.0 diff Feb 24, 2024
updated 2.6.0 ← 2.5.1 diff Mar 30, 2023
updated 2.5.1 ← 2.5.0 diff Mar 23, 2022
updated 2.5.0 ← 2.4.1 diff Mar 15, 2022
updated 2.4.1 ← 2.4.0 diff Dec 8, 2020
updated 2.4.0 ← 2.3.1 diff Dec 4, 2020
updated 2.3.1 ← 2.3.0 diff Jul 14, 2020
updated 2.3.0 ← 2.2.0 diff Jul 6, 2020
updated 2.2.0 ← 2.1.0 diff Dec 18, 2019
updated 2.1.0 ← 2.0.0 diff Mar 12, 2019
updated 2.0.0 ← 1.1.0 diff Apr 10, 2018
updated 1.1.0 ← 1.0.0 diff Mar 26, 2017
updated 1.0.0 ← 0.1.6 diff Dec 15, 2016
updated 0.1.6 ← 0.1.5 diff Mar 22, 2016
updated 0.1.5 ← 0.1.4 diff Feb 11, 2016
updated 0.1.4 ← 0.1.3 diff Dec 9, 2015
updated 0.1.3 ← 0.1.2 diff Sep 17, 2015