mcarray.object: Objects for representing MCMC output

mcarray.objectR Documentation

Objects for representing MCMC output

Description

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

Usage

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

Arguments

object, x

an mcarray object

FUN

a function to be used to generate summary statistics

...

additional arguments to the call

Details

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.

Value

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.

Author(s)

Martyn Plummer


rjags documentation built on Sept. 11, 2024, 6:31 p.m.