overlayenvelope {jagshelper} | R Documentation |
Overlay envelope plots
Description
Overlays multiple envelope plots of posterior data.frames
, or outputs returned from jagsUI
.
This would be best suited to a set of posterior data.frames
or 2-d matrices representing sequential vectors of parameter nodes.
Here a single envelope plot is defined as a set of overlayed shaded strips, each corresponding to a given interval width (defaults to 50 percent and 95 percent), with an overlayed median line.
Usage
overlayenvelope(
df,
p = NULL,
x = NA,
row = NULL,
column = NULL,
median = TRUE,
ci = c(0.5, 0.95),
col = NULL,
add = FALSE,
dark = 0.3,
outline = FALSE,
xlab = "",
ylab = "",
main = NULL,
ylim = NULL,
legend = TRUE,
legendnames = NULL,
legendpos = "topleft",
transform = c("none", "exp", "expit"),
...
)
Arguments
df |
Primary input can be specified in a number of ways: either a |
p |
Parameter name, if input to |
x |
Optional vector of X-coordinates for plotting. |
row |
Row to subset, in the case of a 2-d matrix of parameter nodes in-model. |
column |
Column to subset, in the case of a 2-d matrix of parameter nodes in-model. |
median |
Whether to include median line |
ci |
Vector of intervals to overlay. Defaults to 50 percent and 95 percent. |
col |
Vector of colors for plotting |
add |
Whether to add to existing plot |
dark |
Opacity (0-1) for envelopes. Note that multiple overlapping intervals will darken the envelope. Defaults to 0.3. |
outline |
Whether to just envelope outlines |
xlab |
X-axis label |
ylab |
Y-axis label |
main |
Plot title. If the default ( |
ylim |
Y-axis limits for plotting. If the default ( |
legend |
Whether to automatically try to add a legend. Defaults to |
legendnames |
Optional vector of names for a legend. |
legendpos |
Position for optional legend. Defaults to |
transform |
Should the y-axis be (back)transformed? Options are |
... |
additional plotting arguments or arguments to |
Value
NULL
Author(s)
Matt Tyers
See Also
Examples
## usage with list of input data.frames
overlayenvelope(df=list(SS_out$sims.list$cycle_s[,,1],
SS_out$sims.list$cycle_s[,,2]))
## usage with a 3-d input array
overlayenvelope(df=SS_out$sims.list$cycle_s)
## usage with a jagsUI output object and parameter name (2-d parameter)
overlayenvelope(df=SS_out, p="cycle_s")
## usage with a single jagsUI output object and multiple parameters
overlayenvelope(df=SS_out, p=c("trend","rate"))
## exponential transformation
overlayenvelope(df=SS_out, p="cycle_s", transform="exp",
ylab="exp transform")
overlayenvelope(df=SS_out, p="cycle_s", transform="exp",
ylab="exp transform", log="y")