| add_marglik.brma | R Documentation |
Compute the marginal likelihood of a brma model using bridge sampling and store the result in the object.
## S3 method for class 'brma'
add_marglik(object, ...)
object |
a brma model object. |
... |
additional arguments (currently not used). |
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.
The brma object with the marginal likelihood result stored in
object[["marglik"]].
bridge_sampler.brma, logml.brma,
bf.brma, post_prob.brma
## 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)
logml(fit)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.