Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

loo_model_weights.brmsfit

Model averaging via stacking or pseudo-BMA weighting.


Description

Compute model weights for brmsfit objects via stacking or pseudo-BMA weighting. For more details, see loo::loo_model_weights.

Usage

## S3 method for class 'brmsfit'
loo_model_weights(x, ..., model_names = NULL)

Arguments

x

A brmsfit object.

...

More brmsfit objects or further arguments passed to the underlying post-processing functions. In particular, see prepare_predictions for further supported arguments.

model_names

If NULL (the default) will use model names derived from deparsing the call. Otherwise will use the passed values as model names.

Value

A named vector of model weights.

Examples

## Not run: 
# model with population-level effects only
fit1 <- brm(rating ~ treat + period + carry,
            data = inhaler, family = "gaussian")
# model with an additional varying intercept for subjects
fit2 <- brm(rating ~ treat + period + carry + (1|subject),
            data = inhaler, family = "gaussian")
loo_model_weights(fit1, fit2)   

## End(Not run)

brms

Bayesian Regression Models using 'Stan'

v2.15.0
GPL-2
Authors
Paul-Christian Bürkner [aut, cre], Jonah Gabry [ctb], Sebastian Weber [ctb], Andrew Johnson [ctb], Martin Modrak [ctb]
Initial release
2021-03-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.