mcmcplot1 {mcmcplots} | R Documentation |
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 |
col |
colors for plotting each parallel chain. The default is |
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 |
Value
Creates a plot.
Note
Only the first parallel chain is used to create the autocorrelation plot. This function is used by mcmcplot
to create html output for all the parameters of an MCMC simulation.
Author(s)
S. McKay Curtis
References
No references.
See Also
Examples
## 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")