Learn R Programming

mcmcplots (version 0.2)

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, style = c("gray", "plain"))

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.
style
if "gray", then the plotting region is printed with a gray background, otherwise the default plotting region is used.

Value

  • Creates a plot.

Details

No details.

References

No references.

See Also

mcmcplot

Examples

Run this code
## Create fake MCMC output
fakemcmc <- as.mcmc.list(mcmc(sapply(1:5, function(dum) rnorm(1000))))
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