Description Usage Arguments Details Author(s) See Also Examples
View source: R/joint.density.plot.R
This function plots the joint kernel density from samples of two marginal posterior distributions.
1 
x,y 
These are vectors consisting of samples from two marginal
posterior distributions, such as those output by

Title 
This is the title of the joint posterior density plot. 
contour 
This logical argument indicates whether or not contour
lines will be added to the plot. 
color 
This logical argument indicates whether or not color will
be added to the plot. 
Trace 
This argument defaults to 
This function produces either a bivariate scatterplot that may have kernel density contour lines added, or a bivariate plot with kernel densityinfluenced colors, which may also have kernel density contour lines added. A joint density plot may be more informative than two univariate density plots.
The Trace
argument allows the user to view the exploration of
the joint density, such as from MCMC chain output. An efficient
algorithm jumps to random points of the joint density, and an
inefficient algorithm explores more slowly. The initial point of the
trace (which is the first element passed to Trace
) is plotted
with a green dot. The user should consider plotting the joint density of
the two marginal posterior distributions with the highest
IAT
, as identified with the
PosteriorChecks
function, since these are the two least
efficient MCMC chains. Different sequences of iterations may be
plotted. This ‘joint trace plot’ may show behavior of the MCMC
algorithm to the user.
Statisticat, LLC. [email protected]
IAT
,
LaplacesDemon
, and
PosteriorChecks
1 2 3 4 5 6 7 8 9 10  library(LaplacesDemonCpp)
X < rmvn(1000, runif(2), diag(2))
joint.density.plot(X[,1], X[,2], Title="Joint Density Plot",
contour=TRUE, color=FALSE)
joint.density.plot(X[,1], X[,2], Title="Joint Density Plot",
contour=FALSE, color=TRUE)
joint.density.plot(X[,1], X[,2], Title="Joint Density Plot",
contour=TRUE, color=TRUE)
joint.density.plot(X[,1], X[,2], Title="Joint Trace Plot",
contour=FALSE, color=TRUE, Trace=c(1,10))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.