mcarray.object: Objects for representing MCMC output

mcarray.objectR Documentation

Objects for representing MCMC output


An mcarray object is used by the jags.samples function to represent MCMC output from a JAGS model. It is an array with named dimensions, for which the dimensions "iteration" and "chain" have a special status


## S3 method for class 'mcarray'
summary(object, FUN, ...)
## S3 method for class 'mcarray'
print(x, ...)
## S3 method for class 'mcarray'
as.mcmc.list(x, ...)



an mcarray object


a function to be used to generate summary statistics


additional arguments to the call


The coda package defines mcmc objects for representing output from an MCMC sampler, and mcmc.list for representing output from multiple parallel chains. These objects emphasize the time-series aspect of the MCMC output, but lose the original array structure of the variables they represent. The mcarray class attempts to rectify this by preserving the dimensions of the original node array defined in the JAGS model.


The summary method for mcarray objects applies the given function to the array, marginalizing the "chain" and "iteration" dimensions.

The print method applies the summary function with FUN=mean.

The as.mcmc.list method coerces an mcarray to an mcmc.list object so that the diagnostics provided by the coda package can be applied to the MCMC output it represents.


Martyn Plummer

rjags documentation built on April 19, 2022, 5:06 p.m.