Skip to contents

Extract the normalized Pareto smoothed importance sampling (PSIS) weights from a brma model object.

Usage

# S3 method for class 'brma'
loo_weights(object, unit = "estimate", ...)

Arguments

object

a brma model object.

unit

output/deletion unit. See add_loo.

...

currently unused.

Value

An S x K matrix for estimate-unit LOO, or S x G matrix for cluster-unit LOO, with posterior samples in rows and LOO targets in columns. Columns are normalized to sum to one.

Details

LOO must first be computed with object <- add_loo(object, unit = unit). This method extracts the stored PSIS object and does not compute LOO. It does not compute weights across models. For predictive model weights, use loo_model_weights(model_1, model_2); for a model comparison table, use loo_compare(model_1, model_2).

When the score integrates local random effects, these weights reweight global-parameter draws. They must not be applied to full-data sampled local effects as though those were draws from the deletion posterior; local-effect calculations require the corresponding retained-data reconstruction.