Function produces conditional expectation (point forecasts) and prediction intervals for the estimated model.
# S3 method for adam
forecast(object, h = 10, newdata = NULL,
occurrence = NULL, interval = c("none", "prediction", "confidence",
"simulated", "approximate", "semiparametric", "nonparametric", "empirical",
"complete"), level = 0.95, side = c("both", "upper", "lower"),
cumulative = FALSE, nsim = NULL, scenarios = FALSE, ...)# 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, ...)
# S3 method for msdecompose
forecast(object, h = 10, interval = c("parametric",
"semiparametric", "nonparametric", "none"), level = 0.95, model = NULL,
...)
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).
scenarios
- in case of forecast.adam()
and
interval="simulated"
returns matrix with scenarios (future paths) that were
used in simulations.
Time series model for which forecasts are required.
Forecast horizon.
The new data needed in order to produce forecasts.
The vector containing the future occurrence variable (values in [0,1]), if it is known.
What type of mechanism to use for interval construction.
the recommended option is interval="prediction"
, which will use analytical
solutions for pure additive models and simulations for the others.
interval="simulated"
is the slowest method, but is robust to the type of
model. interval="approximate"
(aka interval="parametric"
) uses
analytical formulae for conditional h-steps ahead variance, but is approximate
for the non-additive error models. interval="semiparametric"
relies on the
multiple steps ahead forecast error (extracted via rmultistep
method) and on
the assumed distribution of the error term. interval="nonparametric"
uses
Taylor & Bunn (1999) approach with quantile regressions. interval="empirical"
constructs intervals based on empirical quantiles of multistep forecast errors.
interval="complete"
will call for reforecast()
function and produce
interval based on the uncertainty around the parameters of the model.
Finally, interval="confidence"
tries to generate the confidence intervals
for the point forecast based on the reforecast
method.
Confidence level. Defines width of prediction interval.
Defines, whether to provide "both"
sides of prediction
interval or only "upper"
, or "lower"
.
If TRUE
, then the cumulative forecast and prediction
interval are produced instead of the normal ones. This is useful for
inventory control systems.
Number of iterations to do in cases of interval="simulated"
,
interval="prediction"
(for mixed and multiplicative model),
interval="confidence"
and interval="complete"
.
The default value for the prediction / simulated interval is 1000. In case of
confidence or complete intervals, this is set to 100.
Binary, defining whether to return scenarios produced via
simulations or not. Only works if interval="simulated"
. If TRUE
the object will contain scenarios
variable.
Other arguments accepted by either es, ces, gum or ssarima.
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 multiplicative ETS models).
Ivan Svetunkov, ivan@svetunkov.com
By default the function will generate conditional expectations from the estimated model and will also produce a variety of prediction intervals based on user preferences.
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, Springer-Verlag.
forecast
ourModel <- ces(rnorm(100,0,1),h=10)
forecast(ourModel,h=10)
forecast(ourModel,h=10,interval=TRUE)
plot(forecast(ourModel,h=10,interval=TRUE))
Run the code above in your browser using DataLab