Learn R Programming

mcmcOutput (version 0.1.3)

mcmcOutput-class: Conversion to class mcmcOutput

Description

Convert output containing MCMC chains to the class mcmcOutput. The function is generic, with methods for a range of input objects.

print, summary, plot and window methods are available for the class. See also postPlot, discrepancyPlot, crosscorrPlot, postPriorOverlap.

Usage

mcmcOutput(object, ...)

# S3 method for default mcmcOutput(object, ...)

# S3 method for mcmc.list mcmcOutput(object, header, ...)

# S3 method for mcmc mcmcOutput(object, header, ...)

# S3 method for jagsUI mcmcOutput(object, header, ...)

# S3 method for bugs mcmcOutput(object, header, ...)

# S3 method for rjags mcmcOutput(object, header, ...)

# S3 method for runjags mcmcOutput(object, header, ...)

# S3 method for matrix mcmcOutput(object, nChains=1, header, ...)

# S3 method for data.frame mcmcOutput(object, nChains=1, header, ...)

Value

An object of class mcmcOutput. This is a matrix with a column for the MCMC chain for each node monitored. The first 2 attributes in the list below must be present, the rest are optional but may be used by print or summary methods:

nChainsthe number of chains.
simsLista list specifying which columns correspond to each parameter.
headertext to be displayed as the first line when the object is printed.
callthe original function call.
modelFilethe name of the original model file.
timeTakenthe time taken in seconds for the MCMC run.
runDatean object of class POSIXct with the date of the MCMC run.

Arguments

object

an object containing the MCMC chains; see Details.

header

text to use as the header by print and summary methods.

nChains

the number of chains.

...

named arguments to be passed to other methods (currently not used).

Author

Mike Meredith.

Details

mcmcOutput objects store the output from MCMC estimation runs in a compact and easily accessible format. Several customised extraction methods are available:

$: extracts arrays for individual parameters in the same way as a sims.list.
[ with 1 index: returns a new mcmcOutput object with the selected node(s).
[ with 2 indices: returns the selected row(s) and columns(s).
[ with 3 indices: behaves as an iterations x chains x nodes array.