nStarts {CNPBayes} | R Documentation

## Number of MCMC chains.

### Description

This function retrieves the number of chains used for an MCMC simulation.

### Usage

    nStarts(object)

    nStarts(object) <- value

    ## S4 method for signature 'McmcParams'
    nStarts(object)

    ## S4 replacement method for signature 'McmcParams'
    nStarts(object) <- value

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

    ## S4 replacement method for signature 'MixtureModel'
    nStarts(object) <- value

### Arguments

`object` | see `showMethods(nStarts)`
`value` | new number of chains

### Details

Simulating starting values from the priors makes it imperative to run a large nubmer of simulations for burnin and to carefully evaluate the chains following burning for convergence. The adequacy of the burnin is difficult to assess in high-dimensional settings with a large number of CNPs. To avoid starting in regions of low posterior probabilitiy, we use existing EM-based methods in the package `{mclust}` to select starting values from `N` bootstrap sample of the observed data, where `N` is specificed as in the example below. For each bootstrap sample, starting values for the model are estimated. For each set of simulated starting values, the log likelihood of the full data is evaluated. The starting values with the largest log likelihood are used as initial values for the MCMC simulations.

### Value

An integer of the number of different starts.

### Examples

    number_of_chains <- nStarts(SingleBatchModelExample)
    number_of_chains <- 10
    nStarts(SingleBatchModelExample) <- number_of_chains

[Package CNPBayes version 1.12.0 Index]