plot.dynamic.distribution | R Documentation |
Produces an dynamic distribution plot where gray scale shading is used to show the evolution of a distribution over an index set. This function is particularly useful when the index set is too large to do side-by-side boxplots.
PlotDynamicDistribution(curves,
timestamps = NULL,
quantile.step=.01,
xlim = NULL,
xlab = "Time",
ylim = range(curves, na.rm = TRUE),
ylab = "distribution",
add = FALSE,
axes = TRUE,
...)
curves |
A matrix where each row represents a curve (e.g. a simulation of a time series from a posterior distribution) and columns represent different points in the index set. For example, a long time series would be a wide matrix. |
timestamps |
An optional vector of "time stamps" that
|
quantile.step |
Each color step in the plot corresponds to this difference in quantiles. Smaller values make prettier plots, but the plots take longer to produce. |
xlim |
The x limits (x1, x2) of the plot. Note that |
xlab |
Label for the horzontal axis. |
ylim |
The y limits (y1, y2) of the plot. Note that |
ylab |
Label for the vertical axis. |
add |
Logical. If true then add the plot to the current plot. Otherwise a fresh plot will be created. |
axes |
Logical. Should axes be added to the plot? |
... |
Extra arguments to pass on to |
The function works by passing many calls to
polygon
. Each polygon is associated with a quantile
level, with darker shading near the median.
This function is called for its side effect, which is to produce a plot on the current graphics device.
Steven L. Scott steve.the.bayesian@gmail.com
x <- t(matrix(rnorm(1000 * 100, 1:100, 1:100), nrow=100))
## x has 1000 rows, and 100 columns. Column i is N(i, i^2) noise.
PlotDynamicDistribution(x)
time <- as.Date("2010-01-01", format = "%Y-%m-%d") + (0:99 - 50)*7
PlotDynamicDistribution(x, time)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.