plot.forecast {forecast}R Documentation

Forecast plot

Description

Plots a time series with forecasts and prediction intervals.

Usage

## S3 method for class 'forecast':
plot(x, include, plot.conf = TRUE, shaded = TRUE, shadecols
                                 = switch(1 + (length(x$level) > 1), 7, length(x$level):1),
                shadepalette=heat.colors(length(x$level)+2)[-1], lambda = NULL,
                                 col = 1, fcol = 4, ylim = NULL, main = NULL, ylab = "", xlab = "", ...)
## S3 method for class 'splineforecast':
plot(x,fitcol=2,...)

Arguments

x Forecast object produced by forecast.
include number of values from time series to include in plot
plot.conf Logical flag indicating whether to plot prediction intervals.
shaded Logical flag indicating whether prediction intervals should be shaded (TRUE) or lines (FALSE)
shadecols Colors for shaded prediction intervals
shadepalette Palette for shaded prediction intervals
lambda Box-Cox parameter. If present, function backtransforms data and forecasts using InvBoxCox.
col the colour for the data line.
fcol the colour for the forecast line.
ylim Limits on y-axis
main Main title
ylab Y-axis label
xlab X-axis label
fitcol Line colour for fitted values.
... additional arguments to plot.

Value

None.

Author(s)

Rob J Hyndman

References

Makridakis, Wheelwright and Hyndman (1998) Forecasting: methods and applications, Wiley: New York. http://www.robhyndman.info/forecasting.

See Also

plot.ts

Examples

deaths.fit <- hw(USAccDeaths,h=48)
plot(deaths.fit)

[Package forecast version 1.23 Index]