plotdens | R Documentation |
Produces a kernel density plot of a single or multiple parameter nodes (overlayed).
Input can be of multiple possible formats: either a single or list of output objects
from jagsUI
with an associated vector of parameter names, or a vector or data.frame
of posterior samples.
plotdens(
df,
p = NULL,
exact = FALSE,
add = FALSE,
col = NULL,
shade = TRUE,
lwd = 2,
minCI = 0.99,
legend = TRUE,
legendpos = "topleft",
legendnames = NULL,
main = NULL,
xlab = "",
ylab = "Density",
...
)
df |
Input object for plotting. See examples below. |
p |
Vector of parameter names, if |
exact |
Whether the |
add |
Whether to add to an existing plot ( |
col |
Vector of colors for plotting. If the default ( |
shade |
Whether to shade the regions below the kernel density curve(s).
Defaults to |
lwd |
Line width for kernel density curves. Defaults to |
minCI |
Minimum CI width to include for all density curves. Defaults to 99%. |
legend |
Whether to plot a legend. Defaults to |
legendpos |
Position for automatic legend. Defaults to |
legendnames |
Names for legend |
main |
Plot title. Defaults to "". |
xlab |
X-axis label. Defaults to "". |
ylab |
Y-axis label. Defaults to "Density". |
... |
Optional plotting arguments |
NULL
Matt Tyers
comparedens, comparecat, comparepriors
## jagsUI object with a single parameter
plotdens(asdf_jags_out, p="b1")
## jagsUI object with multiple nodes of a parameter
plotdens(asdf_jags_out, p="a")
## jagsUI object with multiple parameter nodes
plotdens(asdf_jags_out, p=c("a[1]","a[2]","a[3]"))
## data.frame with multiple columns
plotdens(jags_df(asdf_jags_out, p="a"))
## list of jagsUI objects with a single parameter name
plotdens(list(asdf_jags_out,asdf_jags_out,asdf_jags_out), p="b1")
## list of jagsUI objects with a vector of parameter names
plotdens(list(asdf_jags_out,asdf_jags_out,asdf_jags_out), p=c("a[1]","a[2]","a[3]"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.