Learn R Programming

RoBMA (version 4.0.0)

loo.brma: 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 brma
loo(x, unit = "estimate", ...)

Value

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

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.

See Also

add_loo, loo, loo_compare, pareto_k_ids

Examples

Run this code
if (FALSE) {
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)
}
}

Run the code above in your browser using DataLab