posteriorSimulation-method: Run MCMC simulation.

Description Usage Arguments Value See Also Examples

Description

nStarts chains are run. b burnin iterations are run and then discarded. Next, s iterations are run in each crain. The user can also specify an alternative number of components. The mode of the MCMC simulation is also calculated.

Usage

1
2
3
4
5
6
7
posteriorSimulation(object, k)

## S4 method for signature 'MixtureModel'
posteriorSimulation(object)

## S4 method for signature 'TrioBatchModel'
posteriorSimulation(object)

Arguments

object

see showMethods(posteriorSimulation)

k

The number of a priori components. This is optional and if not specified, the stored k model components are used. This parameters is useful for running multiple models of varying components.

Value

An object of class 'MarginalModel' or 'BatchModel'

See Also

See ggMixture for plotting the model-based densities.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Fit model with pre-specified number of components (k=3)
set.seed(123)
## specify small number of iterations so that the example runs quickly
mp <- McmcParams(iter=2, burnin=0, nStarts=3)
sb <- SingleBatchModelExample
mcmcParams(sb) <- mp
posteriorSimulation(sb)

# Run additional iterations, but set nStart = 0 so that the last value of the chain is the first value of the next chain
mcmcParams(sb) <- McmcParams(iter=5, nStarts=0, burnin=0)
posteriorSimulation(sb)

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