compare.many.densities {Boom} | R Documentation |
Compare several density estimates.
Description
Produce a plot that compares the kernel density estimates for each element in a series of Monte Carlo draws of a vector or matrix.
Usage
CompareManyDensities(list.of.arrays,
style = c("density", "box"),
main = "",
color = NULL,
gap = 0,
burn = 0,
suppress.labels = FALSE,
x.same.scale = TRUE,
y.same.scale = FALSE,
xlim = NULL,
ylim = NULL,
legend.location = c("top", "right"),
legend.cex = 1,
reflines = NULL,
...)
Arguments
list.of.arrays |
A list of arrays representing the MCMC draws of the vector or matrix in question. Each list element represents a different group. The first index in each list list element represents the Monte Carlo draw number (or iteration). The remaining indices represent the variables to be plotted. If the first list element has variable names assigned to its indices, these will be used to label the plots. |
style |
The style of plot to use for comparing distributions. |
main |
The main title of the plot. |
color |
A vector of colors to be used for representing the groups. |
gap |
The gap (in lines) between plots. |
burn |
The number of MCMC iterations to be discarded as burn-in. |
suppress.labels |
Logical. If |
x.same.scale |
Logical indicating whether the same horizontal scale should be used for all the plots. |
y.same.scale |
Logical indicating whether the same vertical scale
should be used for all the plots. This argument is ignored if
|
xlim |
Either |
ylim |
Either |
legend.location |
The location of the legend, either on top or
at the right. It can also be |
legend.cex |
The relative scale factor to use for the legend text. |
reflines |
This can be |
... |
Extra arguments passed to |
Author(s)
Steven L. Scott
See Also
Examples
x <- array(rnorm(9000), dim = c(1000, 3, 3))
dimnames(x) <- list(NULL, c("Larry", "Moe", "Curly"), c("Larry", "Eric", "Sergey"))
y <- array(rnorm(9000), dim = c(1000, 3, 3))
z <- array(rnorm(9000), dim = c(1000, 3, 3))
data <- list(x = x, y = y, z = z)
CompareManyDensities(data, color = c("red", "blue", "green"))
CompareManyDensities(data, style = "box")
x <- matrix(rnorm(5000), nrow = 1000)
colnames(x) <- c("Larry", "Moe", "Curly", "Shemp", "???")
y <- matrix(rnorm(5000), nrow = 1000)
z <- matrix(rnorm(5000), nrow = 1000)
data <- list(x = x, y = y, z = z)
CompareManyDensities(data, color = c("red", "blue", "green"))
CompareManyDensities(data, style = "box")