marginalLikelihood-method: Compute the marginal likelihood of a converged model.

Description Usage Arguments Value See Also Examples

Description

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).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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))

Arguments

model

An object of class MarginalModel, or a list of MarginalModel's. Can also be an object of BatchModel or a list of such models.

params

A list containing parameters for marginalLikelihood computation.

Value

A vector of the marginal likelihood of the model(s)

See Also

See marginal_lik for the accessor.

Note: currently thinning of the reduced MCMC chains is not allowed.

Examples

1
2
3
4
5
6
## 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)

scristia/CNPBayes documentation built on Aug. 9, 2020, 7:31 p.m.