Last data update: 2014.03.03
|
R: Trace Plot for a Single Parameter in MCMC Output
Trace Plot for a Single Parameter in MCMC Output
Description
Creates a trace plot for one parameter in an MCMC simulation. This function is called by the mcmcplot function, and is intended for internal use only.
Usage
traplot1(x, col = NULL, lty = 1, style = c("gray", "plain"), ...)
Arguments
x |
an mcmc.list object with a single variable.
|
col |
one or more colors for the trace lines. Default is mcmcplotsPalette(nchains) .
|
lty |
one or more line types for the trace lines.
|
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)
S. McKay Curtis
See Also
mcmcplot1 , denoverplot1 , autplot1
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)))))
traplot(fakemcmc[, "alpha[5]", drop=FALSE])
traplot(fakemcmc[, "alpha[5]", drop=FALSE], style="plain")
Results
|