loo.brma: LOO-PSIS for brma Objects

View source: R/loo.R

loo.brmaR Documentation

LOO-PSIS for brma Objects

Description

Extract the LOO-PSIS object from a brma model object. The LOO must first be computed using add_loo.

Usage

## S3 method for class 'brma'
loo(x, unit = "estimate", ...)

Arguments

x

a brma model object.

unit

output/deletion unit. See add_loo.

...

additional arguments (currently unused).

Details

This function extracts the LOO object that was previously computed and stored using object <- add_loo(object, unit = unit). If LOO has not been computed for the requested unit, an error is thrown.

This is the RoBMA S3 generic and brma method. Use loo directly for raw log-likelihood arrays or matrices.

Value

An object of class c("psis_loo", "loo") as returned by loo.

See Also

add_loo, loo, loo_compare, pareto_k_ids

Examples

## Not run: 
if (requireNamespace("metadat", quietly = TRUE)) {
  data(dat.lehmann2018, package = "metadat")
  fit <- bPET(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")
  fit <- add_loo(fit)

  loo_fit <- loo(fit)
  print(loo_fit)
}

## End(Not run)


RoBMA documentation built on May 7, 2026, 5:08 p.m.