This function is created in order for the package to be compatible with Rob Hyndman's "forecast" package
# S3 method for smooth
forecast(object, h = 10, interval = c("parametric",
"semiparametric", "nonparametric", "none"), level = 0.95,
side = c("both", "upper", "lower"), ...)# S3 method for oes
forecast(object, h = 10, interval = c("parametric",
"semiparametric", "nonparametric", "none"), level = 0.95,
side = c("both", "upper", "lower"), ...)
# S3 method for msdecompose
forecast(object, h = 10, interval = c("parametric",
"semiparametric", "nonparametric", "none"), level = 0.95, model = NULL,
...)
Time series model for which forecasts are required.
Forecast horizon
Type of interval to construct. See es for details.
Confidence level. Defines width of prediction interval.
Defines, whether to provide "both"
sides of prediction
interval or only "upper"
, or "lower"
.
The type of ETS model to fit on the decomposed trend. Only applicable to
"msdecompose" class. This is then returned in parameter "esmodel". If NULL
, then
it will be selected automatically based on the type of the used decomposition (either
among pure additive or among pure additive ETS models).
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).
forecast
aka mean
- point forecasts of the model
(conditional mean).
lower
- lower bound of prediction interval.
upper
- upper bound of prediction interval.
level
- confidence level.
interval
- binary variable (whether interval were produced or not).
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!
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.
# NOT RUN {
ourModel <- ces(rnorm(100,0,1),h=10)
forecast.smooth(ourModel,h=10)
forecast.smooth(ourModel,h=10,interval=TRUE)
plot(forecast.smooth(ourModel,h=10,interval=TRUE))
# }
Run the code above in your browser using DataLab