Learn R Programming

coda (version 0.19-4.1)

mcmc.list: Replicated Markov Chain Monte Carlo Objects

Description

The function `mcmc.list' is used to represent parallel runs of the same chain, with different starting values and random seeds. The list must be balanced: each chain in the list must have the same iterations and the same variables.

Diagnostic functions which act on mcmc objects may also be applied to mcmc.list objects. In general, the chains will be combined, if this makes sense, otherwise the diagnostic function will be applied separately to each chain in the list.

Since all the chains in the list have the same iterations, a single time dimension can be ascribed to the list. Hence there are time series methods time, window, start, end, frequency and thin for mcmc.list objects.

An mcmc.list can be indexed as if it were a single mcmc object using the [ operator (see examples below). The [[ operator selects a single mcmc object from the list.

Usage

mcmc.list(...)
as.mcmc.list(x, ...)
is.mcmc.list(x)

Arguments

...

a list of mcmc objects

x

an object that may be coerced to mcmc.list

Author

Martyn Plummer

See Also

mcmc.

Examples

Run this code
data(line)
x1 <- line[[1]]                    #Select first chain
x2 <- line[,1, drop=FALSE]         #Select first var from all chains
varnames(x2) == varnames(line)[1]  #TRUE

Run the code above in your browser using DataLab