marginalLikelihood {CNPBayes} | R Documentation |
The recommended function for fitting mixture models and evaluating convergence is through the ‘gibbs' function. This function will return a list of models ordered by the marginal likelihood. The marginal likelihood is computed using the Chib’s estimator (JASA, Volume 90 (435), 1995).
marginalLikelihood(model, params = mlParams()) ## S4 method for signature 'MultiBatchModel' marginalLikelihood(model, params = mlParams()) ## S4 method for signature 'MultiBatchPooled' marginalLikelihood(model, params = mlParams()) ## S4 method for signature 'list' marginalLikelihood(model, params = mlParams(warnings = FALSE))
model |
An object of class |
params |
A list containing parameters for marginalLikelihood computation. See |
A vector of the marginal likelihood of the model(s)
See mlParams
for parameters related to computing the log marginal likelihood via Chib's estimator. See gibbs
for fitting multiple mixture models and returning a list sorted by the marginal likelihood. See marginal_lik
for the accessor.
Note: currently thinning of the reduced MCMC chains is not allowed.
## In practice, run a much longer burnin and increase the number of ## iterations to save after burnin mm <- SingleBatchModelExample mcmcParams(mm) <- McmcParams(iter=50, burnin=0, nStarts=0) mm <- posteriorSimulation(mm) marginalLikelihood(mm)