loo_compare function

Compare LOO CV models

Compare LOO CV models

Given multiple loocv outputs, calculate differences in their expected log predictive density.

loo_compare(...)

Arguments

  • ...: A series of baggr_cv objects passed as arguments, with a minimum of 2 arguments required for comparison. baggr_cv objects can be created via the loocv function. In instances where more than 2 arguments are passed, the first model will be compared sequentially to all other provided models. Arguments can be passed with names (see example below).

Returns

Returns a series of comparisons in order of the arguments provided as Model 1 - Model N for N loocv objects provided. Model 1 corresponds to the first object passed and Model N corresponds to the Nth object passed.

Examples

## Not run: # 2 models with more/less informative priors -- this will take a while to run cv_1 <- loocv(schools, model = "rubin", pooling = "partial") cv_2 <- loocv(schools, model = "rubin", pooling = "partial", prior_hypermean = normal(0, 5), prior_hypersd = cauchy(0,2.5)) loo_compare("Default prior"=cv_1,"Alternative prior"=cv_2) ## End(Not run)

See Also

loocv for fitting LOO CV objects and explanation of the procedure; loo package by Vehtari et al (available on CRAN) for a more comprehensive approach

  • Maintainer: Witold Wiecek
  • License: GPL (>= 3)
  • Last published: 2024-02-12