Plot Markov chain Monte Carlo traces. This is a diagnostic plot for deciding whether a chain shows unwanted trends.
plotTrace(mcmc, axes=FALSE, same.limits=FALSE,
between=list(x=axes,y=axes), div=1, span=1/4, log=FALSE,
base=10, main=NULL, xlab=NULL, ylab=NULL, cex.main=1.2,
cex.lab=1, cex.axis=0.8, cex.strip=0.8, col.strip="gray95",
las=0, tck=0.5, tick.number=5, lty.trace=1, lwd.trace=1,
col.trace="gray", lty.median=1, lwd.median=1,
col.median="black", lty.loess=2, lwd.loess=1,
col.loess="black", plot=TRUE, …)
MCMC chain(s) as a vector, data frame or mcmc
object.
whether axis values should be plotted.
whether panels should have same x-axis limits.
list with x
and y
indicating panel
spacing.
denominator to shorten values on the y axis.
smoothness parameter, passed to panel.loess
whether values should be log-transformed.
logarithm base.
main title.
x-axis title.
y-axis title.
size of main title.
size of axis labels.
size of tick labels.
size of strip labels.
color of strip labels.
orientation of tick labels: 0=parallel, 1=horizontal, 2=perpendicular, 3=vertical.
tick mark length.
number of tick marks.
line type of trace.
line width of trace.
color of trace.
line type of median.
line width of median.
color of median.
line type of loess.
line width of loess.
color of loess.
whether to draw plot.
passed to xyplot
and panel.loess
.
When plot=TRUE
, a trellis plot is drawn and a data frame is
returned, containing the data used for plotting. When
plot=FALSE
, a trellis object is returned.
xyplot
and panel.loess
are the underlying drawing functions, and
traceplot
is a similar non-trellis plot.
plotTrace
, plotAuto
, plotCumu
, and
plotSplom
are diagnostic plots.
plotDens
and plotQuant
are posterior
plots.
plotMCMC-package
gives an overview of the package.
# NOT RUN {
plotTrace(xpar, xlab="Iterations", ylab="Parameter value",
layout=c(2,4))
plotTrace(xpar$R0, axes=TRUE, div=1000)
# }
Run the code above in your browser using DataLab