diagnostics: Graphical diagnostics for arrays of MCMC output.

Description Usage Arguments Value Examples

Description

This function generates graphical diagnostics for an array of MCMC output such as that returned by applying the function to.array to a stanfit object. For every parameter, a row of three plots is generated: a trace plot, an ACF plot and a kernel density plot. If there is output from more than one chain, the default behaviour is to overlay the plots for different chains in different colours.

Usage

1
2
diagnostics(mcmc, rows = 3, lag.max = 50, pool = FALSE,
  colours = NULL)

Arguments

mcmc

A matrix with dimensions: iterations, parameters; or a three dimensional array with dimensions: iterations, chains, parameters. The final (i.e. parameter) component of the dimnames attribute of the matrix or array should contain the parameter names.

rows

A number indicating the number of parameters to plot per page on the graphics device.

lag.max

A number indicating the maximum lag for the ACF plots.

pool

A logical. If TRUE the samples are pooled across chains before generating the plots.

colours

A vector indicating the colours to use to represent each chain. Colours can be specified using any of the three kinds of R colour specifications, i.e. a colour name (as listed by colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" or a positive integer i meaning palette()[i].

Value

NULL

Examples

1
2
3
srs = array(rnorm(8000), c(1000, 2, 4)) # Example for illustration only!
dimnames(srs) = list(NULL, NULL, paste("theta[",1:4,"]",sep=""))
diagnostics(srs)

nclSLR documentation built on May 2, 2019, 5:17 p.m.

Related to diagnostics in nclSLR...