Learn R Programming

smooth (version 2.4.7)

forecast.smooth: Forecasting time series using smooth functions

Description

This function is created in order for the package to be compatible with Rob Hyndman's "forecast" package

Usage

# S3 method for smooth
forecast(object, h = 10, intervals = c("parametric",
  "semiparametric", "nonparametric", "none"), level = 0.95, ...)

Arguments

object

Time series model for which forecasts are required.

h

Forecast horizon

intervals

Type of intervals to construct. See es for details.

level

Confidence level. Defines width of prediction interval.

...

Other arguments accepted by either es, ces, gum or ssarima.

Value

Returns object of class "smooth.forecast", which contains:

  • model - the estimated model (ES / CES / GUM / SSARIMA).

  • method - the name of the estimated model (ES / CES / GUM / SSARIMA).

  • fitted - fitted values of the model.

  • actuals - actuals provided in the call of the model.

  • forecast aka mean - point forecasts of the model (conditional mean).

  • lower - lower bound of prediction intervals.

  • upper - upper bound of prediction intervals.

  • level - confidence level.

  • intervals - binary variable (whether intervals were produced or not).

  • residuals - the residuals of the original model.

Details

This is not a compulsory function. You can simply use es, ces, gum or ssarima without forecast.smooth. But if you are really used to forecast function, then go ahead!

References

Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, Springer-Verlag. http://www.exponentialsmoothing.net.

See Also

ets, forecast

Examples

Run this code
# NOT RUN {
ourModel <- ces(rnorm(100,0,1),h=10)

forecast.smooth(ourModel,h=10)
forecast.smooth(ourModel,h=10,intervals=TRUE)
plot(forecast.smooth(ourModel,h=10,intervals=TRUE))

# }

Run the code above in your browser using DataLab