Learn R Programming

HelpersMG (version 2026.8.24)

ELPDweight: Return the probability of models compared with loo being the best for prediction

Description

Calculate the probability of models compared with loo being the best for prediction. It uses simulation using the pointwise LOO log-predictive densities. This preserves the correlation between models, because all models are evaluated on the same observations. This is the approach recommended by Aki Vehtari et al. (2017) when uncertainty in model comparison matters.

Usage

ELPDweight(
  loos = stop("A named list of loo data must be provided."),
  nreplicates = 10000
)

Value

A vector with the probabilities

Arguments

loos

A named list of loos

nreplicates

Number of replicates.

Author

Marc Girondot marc.girondot@gmail.com

Details

ELPDweight calculates the probability that each model is best for prediction

References

Vehtari, A., Gelman, A., & Gabry, J. (2017). Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC. Statistics and Computing, 27(5), 1413-1432. https://doi.org/10.1007/s11222-016-9696-4

See Also

Other AIC: ExtractAIC.glm(), FormatCompareAIC(), compare_AIC(), compare_AICc(), compare_BIC()

Examples

Run this code
if (FALSE) {
model1_loo <- loo::loo(model1)
model2_loo <- loo::loo(model2)
ELPDweight(list(model1=model1_loo, model2=model2_loo))
}

Run the code above in your browser using DataLab