bridge_sampler.brma: Bridge Sampling for brma Objects

View source: R/bridgesampling.R

bridge_sampler.brmaR Documentation

Bridge Sampling for brma Objects

Description

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

Usage

## S3 method for class 'brma'
bridge_sampler(samples, ...)

Arguments

samples

a brma model object.

...

additional arguments (currently not used).

Details

This function extracts the bridge sampling object that was previously computed and stored using add_marglik. If the marginal likelihood has not been computed, an error is thrown. Product-space model-averaging objects (BMA.norm, BMA.glmm, and RoBMA) do not expose bridge-sampling marginal likelihoods.

The returned object can be used for Bayesian model comparison via bf and post_prob.

Value

An object of class "bridge" as returned by bridge_sampler.

See Also

add_marglik, bridge_sampler, logml.brma, bf.brma, post_prob.brma

Examples

## Not run: 
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)

  bridge <- bridge_sampler(fit)
  print(bridge)
}

## End(Not run)


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