PSIS-LOO of a Bayesian GLM
bayes_loo.RdLeave-one-out expected log predictive density on the training data, by
Pareto-smoothed importance sampling (elpd_loo()), with each
observation's relative efficiency estimated from the chains. Its
pointwise values feed stacking_weights().
Arguments
- model
A bayes_glm_model, a bayes_odp_fit (or a single-segment bayes_odp_fits), bayes_bf_fit or bayes_bf_normalised_fit for the PSIS-LOO of its observed increments, a meyers_fit (or a single-segment meyers_fits) for that of its observed cells on the log scale, or a compartmental_fit for that of its observed outstanding and paid amounts (with
n_outstanding,elpd_outstandingandelpd_paid).
Value
As elpd_loo().
Examples
d <- data.frame(claims = rep(c(1, 2, 3, 5), 10), x = rep(c(-1.5, -0.5, 0.5, 1.5), 10))
m <- bayes_glm_fit(claims ~ x, d, family = "poisson", chains = 2, tune = 300, draws = 300)
bayes_loo(m)$estimates
#> elpd se p ic
#> -56.60781629 1.74224952 0.07100918 113.21563258