Description Usage Arguments Value Notes See Also Examples
contour_matrix
generates an M*M
matrix of scatter/density plots.
Given an array of data with M
columns (variables) and N
rows
(observations), produce a matrix of plots showing contours for each pair of
parameters. The pairs()
function shows a matrix of scatter plots for
each pair of variables, here the scatter plots are replaced by contour plots.
The contours are produced by using MASS:kde2d
to produce a 2D Gaussian
kernal density estimate, and finding the contours that encolse a fraction
(prob) of the total density.
1 2 3 4 5 6 7 | contour_matrix(theta, ranges = NULL, cex = 1, prob.levels = c(0.9,
0.95), labels = colnames(theta), upper = NA, dot.level = NULL,
breaks = 30, smooth1d = TRUE, smooth2d = TRUE, npix = 100,
cex.lab = 1, cex.axis = 1, prob1d = NULL, sigma = FALSE,
jittr = FALSE, thin = NULL, pch = 1, col = "black",
plot.image = FALSE, plot.1dlines = TRUE, fill.col = "steelblue3",
...)
|
theta |
(array) |
ranges |
(array) |
cex |
(float) character expansion factor. |
prob.levels |
(float) probability levels, e.g. to plot contours enclosing 90% and 95% of the mass on 2D distributions |
labels |
(array of strings) names of the variables |
upper |
(string) plot also in upper-right triangle. See notes. |
dot.level |
(integer) draw dots outside of which contour? (1,2,...) |
breaks |
(integer) how many bins for 1D histograms |
smooth1d |
(logical) plot smoothed distributions, rather than histograms on the leading diagonal? |
smooth2d |
(logical) use smooth, kernel density estimates, rather than 2D histograms? |
npix |
(integer) use |
cex.lab |
(float) expansion factor for axis labels. |
cex.axis |
(float) expansion factor for axis names. |
prob1d |
(float array) probability levels at which to mark intervals on 1D distributions, e.g. c(0.683, 0.90). |
sigma |
(logical) are probability levels |
jittr |
(logical) add 'jitter' to points to reduce overlap. |
thin |
(integer) a factor by which to 'thin out' data input data
i.e. plot only a fraction |
col |
(string) colour of the data points. |
plot.image |
(logical) Plot a colour image underneath the contours? |
plot.1dlines |
(logical) Mark intervals on 1D plots (histogram/density)? |
fill.col |
(string) Colour to use under the histogram. |
... |
(anything) any other graphical keywords to be passed to
|
Array of the 1D intervals for each parameter, or NULL.
The input chain
should be a list such as produced by
gw_sampler
or mh_sampler
that contains the following:
(array) n * ndim
array of posterior samples
n
samples of ndim
vectors of parameters
(string) name of MCMC method used
number of chains/walkers used
The upper
parameter determines what is to be shown in the upper-right
corner of the plot. The options are:
"NA"
- no plot
"points"
- scatter plot of points
"image"
- intensity map
"contour"
- contour map
You may notice that the fraction of points plotted outside the
dot.levels
contour line is often smaller than
prob.levels[dot.levels]
. This is usually true for finite N
and
is a natural consequence of plotting contours that enclose a fraction of the
smoothed density rather than a fraction of the points.
gw_sampler
, mh_sampler
,
get_levels2d
, get_levels1d
,
interp_image
, hist2d
, plot_density
,
plot_density_contours
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.