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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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")