Learn R Programming

plotMCMC (version 2.0.1)

plotQuant: Plot MCMC Quantiles

Description

Plot quantiles of multiple Markov chain Monte Carlo chains, using bars, boxes, or lines.

Usage

plotQuant(mcmc, style="boxes", probs=c(0.025,0.975), axes=TRUE,
          names=NULL, ylim=NULL, yaxs="i", div=1, log=FALSE, base=10,
          main=NULL, xlab=NULL, ylab=NULL, cex.axis=0.8, las=1,
          tck=-0.015, tick.number=8, lty.median=1*(style!="bars"),
          lwd.median=1+1*(style!="boxes"), col.median="black",
          lty.outer=1+2*(style=="lines"), lwd.outer=1,
          col.outer="black", pch=16, cex=0.8, col="black",
          boxfill="darkgray", boxwex=0.5, staplewex=0.5, sfrac=0.005,
          mai=c(0.8,1,1,0.6),
          mgp=list(bottom=c(2,0.4,0),left=c(3,0.6,0),top=c(0,0.6,0),
          right=c(0,0.6,0)), …)

Arguments

mcmc

MCMC chains as a data frame or mcmc object.

style

how quantiles should be drawn: "bars", "boxes", or "lines".

probs

vector of outer quantiles to draw, besides the median.

axes

numeric vector indicating which axis labels should be drawn: 1=bottom, 2=left, 3=top, 4=right, or TRUE to display all (default).

names

x-axis labels.

ylim

y-axis limits.

yaxs

y-axis style: "i" to truncate exactly at limits (default) or "r" to extend the axis slightly beyond the limits.

div

denominator to shorten values on the y axis.

log

whether values should be log-transformed.

base

logarithm base.

main

main title.

xlab

x-axis label.

ylab

y-axis label.

cex.axis

size of tick labels.

las

orientation of tick labels: 0=parallel, 1=horizontal, 2=perpendicular, 3=vertical.

tck

tick mark length.

tick.number

number of tick marks.

lty.median

line type of median.

lwd.median

line width of median.

col.median

color of median.

lty.outer

line type of outer quantiles.

lwd.outer

line width of outer quantiles.

col.outer

color of outer quantiles.

pch

symbol for points.

cex

size of points.

col

color of points.

boxfill

color of boxes.

boxwex

width of boxes.

staplewex

width of error bar staples when style="boxes", as a fraction of box width.

sfrac

width of error bar staples when style="bars", as a fraction of plot region.

mai

margins around plot as a vector of four numbers (bottom, left, top, right).

mgp

margins around axis titles, labels, and lines as a list of four vectors (bottom, left, top, right).

passed to plot, bxp, plotCI, lines, matplot, axis, and title.

Value

List containing:

x

midpoint coordinates on the x axis.

y

quantile coordinates on the y axis.

See Also

bxp, plotCI, and matplot are the underlying drawing functions.

plotTrace, plotAuto, plotCumu, and plotSplom are diagnostic plots.

plotDens and plotQuant are posterior plots.

plotMCMC-package gives an overview of the package.

Examples

Run this code
# NOT RUN {
plotQuant(xrec, names=substring(names(xrec),3), div=1000, xlab="Year",
          ylab="Recruitment (million one-year-olds)")
plotQuant(xbio, div=1000, xlab="Year", ylab="Biomass age 4+ (kt)")
plotQuant(xbio, style="bars", div=1000, sfrac=0, xlab="Year",
          ylab="Biomass age 4+ (kt)")
plotQuant(xbio, style="lines", div=1000, xlab="Year",
          ylab="Biomass age 4+ (kt)")
plotQuant(xpro, axes=1:2, div=1000, xlab="Year",
          ylab="Biomass age 4+ (kt)")
# }

Run the code above in your browser using DataLab