Skip to content

loo v2.0.0

Choose a tag to compare

@jgabry jgabry released this 13 Apr 16:03
· 850 commits to master since this release

See release notes below or at mc-stan.org/loo/news.

Installation

Note: If you are an rstanarm user don't update loo without also installing rstanarm v2.17.4. For brms users make sure to install brms v2.2.0.

Install from CRAN:

install.packages("loo")

Install from GitHub:

# note: setting build_vignettes=FALSE will be faster and you can always access 
# the vignettes at mc-stan.org/loo/articles/

devtools::install_github("stan-dev/loo", ref = "v2.0.0", build_vignettes = TRUE) 

Release notes

This is a major release with many changes. Whenever possible we have opted to
deprecate rather than remove old functionality, but it is possible that old code
that accesses elements inside loo objects by position rather than name may
error.

  • New package documentation website http://mc-stan.org/loo/ with new vignettes,
    function reference, news.

  • Updated existing vignette and added two new vignettes demonstrating how to use
    the package.

  • New function psis() replaces psislw() (now deprecated). This version
    implements the improvements to the PSIS algorithm described in the latest
    version of https://arxiv.org/abs/1507.02646. Additional diagnostic
    information is now also provided, including PSIS effective sample sizes.

  • New weights() method for extracting smoothed weights from a psis object.
    Arguments log and normalize control whether the weights are returned on the
    log scale and whether they are normalized.

  • Updated the interface for the loo() methods to integrate nicely with the new
    PSIS algorithm. Methods for log-likelihood arrays, matrices, and functions
    are provided. Several arguments have changed, particularly for the
    loo.function method. The documentation at help("loo") has been updated to
    describe the new behavior.

  • The structure of the objects returned by the loo() function has also changed
    slightly, as described in the Value section at help("loo", package = "loo").

  • New function loo_model_weights() computes weights for model averaging as
    described in https://arxiv.org/abs/1704.02030. Implemented methods include
    stacking of predictive distributions, pseudo-BMA weighting or pseudo-BMA+
    weighting with the Bayesian bootstrap.

  • Setting options(loo.cores=...) is now deprecated in favor of
    options(mc.cores=...). For now, if both the loo.cores and mc.cores options
    have been set, preference will be given to loo.cores until it is removed in a
    future release. (thanks to @cfhammill)

  • New functions example_loglik_array() and example_loglik_matrix() that
    provide objects to use in examples and tests.

  • When comparing more than two models with compare(), the first column of the
    output is now the elpd difference from the model in the first row.

  • New helper functions for splitting observations for K-fold CV:
    kfold_split_random(), kfold_split_balanced(), kfold_split_stratified().
    Additional helper functions for implementing K-fold CV will be included in
    future releases.