Plot Markov chain Monte Carlo density. This is an approximation of the posterior probability density function.
plotDens(mcmc, probs=c(0.025,0.975), points=FALSE, axes=TRUE,
same.limits=FALSE, between=list(x=axes,y=axes), div=1,
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.density=1, lwd.density=3, col.density="black",
lty.median=2, lwd.median=1, col.median="darkgray", lty.outer=3,
lwd.outer=1, col.outer="darkgray", pch="|", cex.points=1,
col.points="black", plot=TRUE, …)
MCMC chain(s) as a vector, data frame or mcmc
object.
vector of outer quantiles to draw, besides the median.
whether individual points should be plotted along the x axis.
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 x axis.
whether values should be log-transformed.
logarithm base.
main title.
x-axis label.
y-axis label.
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 density curve.
line width of density curve.
color of density curve.
line type of median.
line width of median.
color of median.
line type of outer quantiles.
line width of outer quantiles.
color of outer quantiles.
symbol for points.
size of points.
color of points.
whether to draw plot.
passed to densityplot
and
panel.densityplot
.
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.densityplot
are the underlying drawing
functions, and link[coda]{densplot}
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 {
plotDens(xbio$"2004", points=TRUE, div=1000, main="2004\n",
xlab="Biomass age 4+ (kt)", tick.number=6, strip=FALSE)
plotDens(xpar, xlab="Parameter value", ylab="Posterior density\n")
# }
Run the code above in your browser using DataLab