autplot1 {mcmcplots} | R Documentation |
Autocorrelation Plot of MCMC Output
Description
Creates an autocorrelation or partial autocorrelation plot of MCMC output.
Usage
autplot1(x, chain = 1, lag.max = NULL, partial = FALSE,
col = mcmcplotsPalette(1), style = c("gray", "plain"),
ylim = NULL, ...)
Arguments
x |
an |
chain |
the number of the parallel chain for plotting. The default is to use the first parallel chain. |
lag.max |
passed as an argument to the autocorrelation function |
partial |
logical indicating whether paritial autocorrelation should be plotted. |
col |
color of the bars in the plot. |
style |
if "gray", then the plotting region is printed with a gray background, otherwise the default plotting region is used. |
ylim |
limits for the y-axis. |
... |
further arguments passed to the plotting function. |
Details
None.
Value
Creates a plot.
Author(s)
S. McKay Curtis (adapted from Martyn Plummer's autcorr.plot
code in the coda package)
References
None.
See Also
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)))))
autplot1(fakemcmc[, "alpha[1]", drop=FALSE])
autplot1(fakemcmc[, "alpha[1]", drop=FALSE], chain=2, style="plain")
autplot1(fakemcmc[, "alpha[1]", drop=FALSE], partial=TRUE)
[Package mcmcplots version 0.4.3 Index]