Compute the marginal likelihood of a brma model using bridge sampling and store the result in the object.
Details
The marginal likelihood is computed using the bridgesampling package
via the BayesTools::JAGS_bridgesampling wrapper. The result is stored
in the object and can be extracted using bridge_sampler.brma.
Product-space model-averaging objects (BMA.norm, BMA.glmm,
and RoBMA) do not expose a bridge-sampling marginal likelihood;
use predictive comparison methods such as loo.brma instead.
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)
bridge <- bridge_sampler(fit)
print(bridge)
logml(fit)
}
} # }