# S3 method for brmsfit
r2_loo_posterior(model, verbose = TRUE, ...)
# S3 method for stanreg
r2_loo_posterior(model, verbose = TRUE, ...)
Arguments
model
A Bayesian regression model (from brms,
rstanarm, BayesFactor, etc).
robust
Logical, if TRUE, the median instead of mean is used to
calculate the central tendency of the variances.
ci
Value or vector of probability of the CI (between 0 and 1) to be
estimated.
verbose
Toggle off warnings.
...
Arguments passed to r2_posterior().
Value
A list with the Bayesian R2 value. For mixed models, a list with the
Bayesian R2 value and the marginal Bayesian R2 value. The standard errors
and credible intervals for the R2 values are saved as attributes.
A list with the LOO-adjusted R2 value. The standard errors
and credible intervals for the R2 values are saved as attributes.
Details
r2_loo() returns an "adjusted" R2 value computed using a
leave-one-out-adjusted posterior distribution. This is conceptually similar
to an adjusted/unbiased R2 estiamte in classical regression modeling. See
r2_bayes() for an "unadjusted" R2.
Mixed models are not currently fully supported.
r2_loo_posterior() is the actual workhorse for r2_loo() and
returns a posterior sample of LOO-adjusted Bayesian R2 values.