Extract the LOO-PSIS object from a brma model object.
The LOO must first be computed using add_loo.
Arguments
- x
a brma model object.
- unit
output/deletion unit. See
add_loo.- ...
additional arguments (currently unused).
Value
An object of class c("psis_loo", "loo") as returned by
loo.
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.
Examples
if (FALSE) { # \dontrun{
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)
}
} # }