Learn R Programming

MethComp (version 1.22.2)

check.MCmcmc: Functions to graphically assess the convergence of the MCMC-simulation in a MCmcmc object

Description

These functions display traces, posterior densities and autocorrelation functions for the relevant subset of the parameters in a MCmcmc object.

Usage

"trace"( obj, what = "sd", scales = c("same", "free"), layout = "col", aspect = "fill", ...)
"post"( obj, what ="sd", check = TRUE, scales = "same", layout = "row", lwd = 2, col, plot.points = FALSE, aspect = "fill", ... ) "pairs"( x, what = "sd", subset, col = NULL, pch = 16, cex = 0.2, scales = "free", ... )

Arguments

obj
A MCmcmc object.
x
A MCmcmc object.
what
Character indicating what parameters to plot. Possible values are "sd" or "var" which gives plots for the variance components (on the sd. scale), "beta" or "slope", which gives plots for slope parameters and "alpha" or "int", which gives plots for the intercept parameters.
scales
Character vector of length two, with possible values "same" or "free", indicating whether x- and y-axes of the plots should be constrained to be the same across panels. For pairs only the first element is used to decide whether all panles should have the same axes.
layout
Character. If "col" parameters are displayed columnwise by method, if "row" they are displayed row-wise.
aspect
How should the panels be scaled. Default ("fill") is to make a panels take up as much place as possible.
check
Logical. Should the density plots be separate for each chain (in order to check convergence) or should the chains be merged.
lwd
Width of the lines used for plotting of the posterior densities.
col
Color of the lines points used for plotting of the posterior densities.
plot.points
Logical. Should a rug with actual data points be plotted beneath the density.
pch
Plot symbol for the points.
subset
Character or numerical indicating the columns of the posterior that should be plotted by pairs.
cex
Plot character size for points in pairs.
...
Further aruments passed on to the Lattice function called: trace calls xyplot from the coda package, post calls densityplot from the coda package,

pairs calls pairs from the graphics package.

Value

A Lattice plot.

Details

A Lattice plot is returned, which means that it must printed when these functions are called in a batch program or inside another function or for-loop.

trace plots traces of the sampled chains, post plots posterior densities of the parameters and pairs plots a scatter-plot matrix of bivariate marginal posterior distributions.

See Also

MCmcmc, plot.MCmcmc, ox.MC, sbp.MC

Examples

Run this code
# Load a provided MCmcmc object
data( ox.MC )
trace.MCmcmc( ox.MC, what="beta" )
pairs.MCmcmc( ox.MC, what="sd" )

Run the code above in your browser using DataLab