Learn R Programming

dclone (version 2.3-2)

pairs.mcmc.list: Scatterplot Matrices for 'mcmc.list' Objects

Description

A matrix of scatterplots is produced.

Usage

# S3 method for mcmc.list
pairs(x, n = 25, col = 1:length(x), 
    col.hist = "gold", col.image = terrain.colors(50), 
    density = TRUE, contour = TRUE, mean = TRUE, ...)

Value

The function returns NULL invisibly and produces a plot as a side effect.

Arguments

x

an 'mcmc.list' object.

n

number of of grid points in each direction for two-dimensional kernel density estimation. Can be scalar or a length-2 integer vector.

col

color for chains in upper panel scatterplots.

col.hist

color for histogram fill in diagonal panels.

col.image

color palette for image plot in lower panel scatterplots.

density

logical, if image plot based on the two-dimensional kernel density estimation should be plotted in lower panel.

contour

logical, if contour plot based on the two-dimensional kernel density estimation should be plotted in lower panel.

mean

logical, if lines should indicate means of the posterior densities in the panels.

...

additional graphical parameters/arguments.

Author

Peter Solymos, solymos@ualberta.ca

Details

The function produces a scatterplot matrix for 'mcmc.list' objects. Diagonal panels are posterior densities with labels and rug on the top. Upper panels are pairwise bivariate scatterplots with coloring corresponding to chains, thus highlighting mixing properties although not as clearly as trace plots. Lower panels are two-dimensional kernel density estimates based on kde2d function of MASS package using image and contour.

See Also

pairs, plot.mcmc.list

Two-dimensional kernel density estimation: kde2d in MASS package

Examples

Run this code
data(regmod)
pairs(regmod)

Run the code above in your browser using DataLab