Adds a density region to an existing plot of a normally-distributed quantity with
continuously-varying mean and standard deviation, such as a
time series forecast. Automatically computes a reasonable set of
ordinates to evaluate the density at, which span the whole forecast
space.
Usage
## S3 method for class 'normal'
densregion(x, mean, sd, ny=20, ...)
Arguments
x
Suppose the continuously-varying quantity varies over a
space S. x is a vector of the points in S at which the
posterior / predictive / fiducial distribution will be evaluated.
mean
Vector of normal means at each point in x.
sd
Vector of standard deviations at each point in x.
ny
Minimum number of points to calculate the density at for
each x. The density is calculated for at least ny equally
spaced normal quantiles for each point. The density is actually
calculated at the union over x of all such points, for each x.
...
Further arguments passed to densregion.
Details
The plot is shaded by interpolating the value of the density
between grid points, using the algorithm described by Cleveland (1993)
as implemented in the filled.contour function.
Author(s)
Christopher Jackson <chris.jackson@mrc-bsu.cam.ac.uk>