This function produces a fan chart of sequential (one-step-ahead) forecasts with dots for the observed values, using surveillance::fanplot(), which itself wraps fanplot::fan(). A matplot() of score values at each time point is added below ("slicing").

osaplot(quantiles, probs, means, observed, scores, start = 1,
  xlab = "Time", fan.args = list(), means.args = list(),
  observed.args = list(), key.args = list(), ..., scores.args = list(),
  legend.args = list(), heights = c(0.6, 0.4))

Arguments

quantiles

a time x probs matrix of forecast quantiles at each time point.

probs

numeric vector of probabilities with values between 0 and 1.

means

(optional) numeric vector of point forecasts at each time point.

observed

(optional) numeric vector of observed values.

scores

(optional) numeric vector (or matrix) of associated scores.

start

time index (x-coordinate) of the first prediction.

xlab

x-axis label.

fan.args

a list of graphical parameters for the fanplot::fan(), e.g., to employ a different colorRampPalette() as fan.col, or to enable contour lines via ln.

means.args

a list of graphical parameters for lines() to modify the plotting style of the point predictions.

observed.args

a list of graphical parameters for lines() to modify the plotting style of the observed values.

key.args

if a list, a color key (in fanplot::fan()'s "boxfan"-style) is added to the fan chart. The list may include positioning parameters start (the x-position) and ylim (the y-range of the color key), space to modify the width of the color key, and rlab to modify the labels. An alternative way of labeling the quantiles is via the argument ln in fan.args.

...

further arguments are passed to plot.default().

scores.args

a list of graphical parameters for matplot() to modify the style of the scores subplot at the bottom.

legend.args

if a list (of parameters for legend()) and ncol(scores) > 1, a legend is added to the scores subplot.

heights

numeric vector of length 2 specifying the relative height of the two subplots.

Author

Sebastian Meyer