Learn R Programming

mcmcplots (version 0.4.3)

mcmcplot1: MCMC Diagnostics Plots for one Model Parameter

Description

Creates a graph window containing three different plots---a trace plot, a density plot, and an autocorrelation plot---for one parameter in an MCMC run. This function is used by mcmcplot to construct an html file of MCMC diagnostics. This function is intended for internal use only.

Usage

mcmcplot1(x, col = mcmcplotsPalette(n), lty = 1, xlim = NULL, ylim =
NULL, style = c("gray", "plain"), greek = FALSE)

Arguments

x

an mcmc object with a single variable.

col

colors for plotting each parallel chain. The default is seq(nchains)+1 where nchains is the number of parallel chains in mcmcout. If there is only one parallel chain, then the default is 1.

lty

line types for plotting each parallel chain. The default is 1 for all parallel chains.

xlim

limits for the x axis of the density plot.

ylim

limits for the y axis of the density plot.

style

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

greek

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

Value

Creates a plot.

References

No references.

See Also

mcmcplot

Examples

Run this code
# NOT RUN {
## Create fake MCMC output
fakemcmc <- coda::as.mcmc.list(coda::mcmc(sapply(1:5, function(dum) rnorm(1000))))
coda::varnames(fakemcmc) <- c("gamma[1,1]", "gamma[1,2]", "gamma[1,3]", "sigma[1]", "sigma[2]")

mcmcplot1(fakemcmc[, "sigma[1]", drop=FALSE])
mcmcplot1(fakemcmc[, "gamma[1,3]", drop=FALSE], style="plain")
# }

Run the code above in your browser using DataLab