rmeanplot {mcmcplots}R Documentation

Running Mean Plots of Multiple Parameters

Description

This function produces running mean plots from an MCMC simulation on a single plot for all parameters (by default) or those parameters indicated by the parms argument.

Usage

rmeanplot(mcmcout, parms = NULL, regex = NULL, random = NULL,
leaf.marker = "[\\[_]", ylim = NULL, auto.layout = TRUE,
mar = c(2, 2, 1.5, 0.25) + 0.1, col = NULL, lty = 1,
plot.title = NULL, main = NULL, greek = FALSE,
style = c("gray", "plain"), ...)

Arguments

mcmcout

an object that can be coerced to an mcmc or mcmc.list object

parms

character vector specifying which subsets of parameters to plot. If NULL, mcmcplot will plot all parameters. Regular expressions are used to strip all numbers and punctuation out of the parameter names to find the parameters that match the character strings in parms.

regex

character vector of regular expressions denoting groups of parameters to plot.

random

an integer indicating the maximum number of parameters to randomly select for plotting from each group of parameters as specified by the parms argument.

leaf.marker

a regular expression with a character class that marks the beginning of the “leaf” portion of a parameter name. The default character class includes [ and _

ylim

limits for the y-axis.

auto.layout

automatically creates a plot layout using mult.fig if TRUE.

mar

argument passed to multi.fig if auto.layout=TRUE

col

colors to be used in plotting the densities. Default is mcmcplotsPalette(nchains).

lty

line types to be used in plotting.

plot.title

title to put in the outer margin. Default is no title.

main

main title for the plots. Default is to use parameter names.

greek

if TRUE, the names of greek letters in the labels will be displayed as greek characters on the plot.

style

if "gray", then the plotting region is printed with a gray background, otherwise the default plotting region is used.

...

further arguments passed to the plotting function.

Value

Creates a plot.

Author(s)

Evangelos Evangelou

Examples

## Create fake MCMC output
nc <- 10; nr <- 1000
pnames <- c(paste("alpha[", 1:5, "]", sep=""), paste("gamma[", 1:5, "]", sep=""))
means <- rpois(10, 20)
fakemcmc <- coda::as.mcmc.list(
    lapply(1:3,
           function(i) coda::mcmc(matrix(rnorm(nc*nr, rep(means,each=nr)),
                                         nrow=nr, dimnames=list(NULL,pnames)))))

## Plot traces of the fake MCMC output
rmeanplot(fakemcmc)
rmeanplot(fakemcmc, style="plain")
rmeanplot(fakemcmc, "gamma", greek=TRUE)

[Package mcmcplots version 0.4.3 Index]