Learn R Programming

mcmcplots (version 0.2)

traplot1: 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 = mcmcplotsPalette(nchains), 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.
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.

Details

None.

References

None.

See Also

mcmcplot, denoverplot1, autplot1

Examples

Run this code
## 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 <- as.mcmc.list(lapply(1:3, function(i) 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")

Run the code above in your browser using DataLab