Skip to contents

Extract the log marginal likelihood from a brma model. The marginal likelihood must first be computed using add_marglik.

Usage

# S3 method for class 'brma'
logml(x, ...)

Arguments

x

a brma model object.

...

additional arguments (currently not used).

Value

A scalar numeric value representing the log marginal likelihood.

Details

This function extracts the log marginal likelihood from the bridge sampling object that was previously computed and stored using add_marglik. Product-space model-averaging objects (BMA.norm, BMA.glmm, BMA.mv, RoBMA, and RoBMA.mv) do not expose bridge-sampling marginal likelihoods.

For repeated standardized results, this method returns the stored scalar median of the included log marginal likelihoods. Legacy raw bridge lists use the upstream scalar median method. Use bridge_sampler to extract the raw bridge repetitions, or bf and post_prob to compare models across repetitions.

Examples

if (FALSE) { # \dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
  data(dat.lehmann2018, package = "metadat")
  fit <- brma(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")

  fit <- add_marglik(fit)

  logml(fit)
}
} # }