Learn R Programming

CNPBayes (version 1.2.2)

marginalLikelihood: Compute the marginal likelihood of a converged model.

Description

Compute the marginal likelihood of a converged model.

Usage

marginalLikelihood(model, params = list(niter = 1000L, root = (1/10), reject.threshold = 1e-50, prop.threshold = 0.5))
"marginalLikelihood"(model, params = list(niter = 1000L, root = (1/10), reject.threshold = 1e-50, prop.threshold = 0.5))
"marginalLikelihood"(model, params = list(niter  = 1000L, root = (1/10), reject.threshold = 1e-50, prop.threshold = 0.5))
"marginalLikelihood"(model, params = list(niter = 1000L, root = (1/10), reject.threshold = 1e-50, prop.threshold = 0.5))
"marginalLikelihood"(model, params = list(niter = 1000L, root = (1/10), reject.threshold = 1e-50, prop.threshold = 0.5))

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: niter - the number of iterations for the reduced Gibb's sampler root - a tempering parameter. Before the log mean of the reduced Gibb's outputs are taken, the root of each iteration is taken reject.threshold - small values for reduced Gibb's output for theta can indicate overfitting. Values below reject.threshold will be flagged prop.threshold - If a proportion prop.threshold or higher of the reduced Gibb's out for theta are smaller than reject.threshold, the marginalLikelihood will not be calculated and a warning will be displayed

Value

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

Examples

Run this code
     marginalLikelihood(MarginalModelExample,
                        params=list(niter=5L,
                                    root=(1/10),
                                    reject.threshold=1e-50,
                                    prop.threshold=0.5))

Run the code above in your browser using DataLab