log_mll: Log marginal likelihood calculation

log_mllR Documentation

Log marginal likelihood calculation

Description

Calculate the log marginal likelihood with bridge sampling (Meng & Wong, 1996). This is a wrapper around bridgesampling::bridge_sampler(). Therefore, log marginal likelihood calculation is currently only available for models estimated with {rstan} using MCMC.

Usage

log_mll(x, ..., force = FALSE)

Arguments

x

A measrdcm object estimated with backend = "optim".

...

Unused.

force

If the criterion has already been added to the model object with add_criterion(), should it be recalculated. Default is FALSE.

Value

The estimate of the log marginal likelihood.

References

Meng, X.-L., & Wong, W. H. (1996). Simulating ratios of normalizing constants via a simple identity: A theoretical exploration. Statistical Sinica, 6(4), 831-860. https://www.jstor.org/stable/24306045

Examples


model_spec <- dcm_specify(
  qmatrix = dcmdata::mdm_qmatrix,
  identifier = "item"
)
model <- dcm_estimate(
  dcm_spec = model_spec,
  data = dcmdata::mdm_data,
  identifier = "respondent",
  method = "variational",
  seed = 63277
)

log_mll(model)


measr documentation built on Jan. 14, 2026, 5:08 p.m.