View source: R/smoothCombine.R
smoothCombine | R Documentation |
Function constructs ETS, SSARIMA, CES, GUM and SMA and combines their forecasts using IC weights.
smoothCombine(y, models = NULL, initial = c("optimal", "backcasting"),
ic = c("AICc", "AIC", "BIC", "BICc"), loss = c("MSE", "MAE", "HAM",
"MSEh", "TMSE", "GTMSE", "MSCE"), h = 10, holdout = FALSE,
cumulative = FALSE, interval = c("none", "parametric", "likelihood",
"semiparametric", "nonparametric"), level = 0.95, bins = 200,
intervalCombine = c("quantile", "probability"), bounds = c("admissible",
"none"), silent = c("all", "graph", "legend", "output", "none"),
xreg = NULL, regressors = c("use", "select"), initialX = NULL, ...)
y |
Vector or ts object, containing data needed to be forecasted. |
models |
List of the estimated smooth models to use in the
combination. If |
initial |
Can be |
ic |
The information criterion used in the model selection procedure. |
loss |
The type of Loss Function used in optimization. There are also available analytical approximations for multistep functions:
Finally, just for fun the absolute and half analogues of multistep estimators
are available: |
h |
Length of forecasting horizon. |
holdout |
If |
cumulative |
If |
interval |
Type of interval to construct. This can be:
The parameter also accepts |
level |
Confidence level. Defines width of prediction interval. |
bins |
The number of bins for the prediction interval. The lower value means faster work of the function, but less precise estimates of the quantiles. This needs to be an even number. |
intervalCombine |
How to average the prediction interval:
quantile-wise ( |
bounds |
What type of bounds to use in the model estimation. The first letter can be used instead of the whole word. |
silent |
If |
xreg |
The vector (either numeric or time series) or the matrix (or
data.frame) of exogenous variables that should be included in the model. If
matrix included than columns should contain variables and rows - observations.
Note that |
regressors |
The variable defines what to do with the provided xreg:
|
initialX |
The vector of initial parameters for exogenous variables.
Ignored if |
... |
This currently determines nothing.
|
The combination of these models using information criteria weights is possible because they are all formulated in Single Source of Error framework. Due to the the complexity of some of the models, the estimation process may take some time. So be patient.
The prediction interval are combined either probability-wise or quantile-wise (Lichtendahl et al., 2013), which may take extra time, because we need to produce all the distributions for all the models. This can be sped up with the smaller value for bins parameter, but the resulting interval may be imprecise.
Ivan Svetunkov, ivan@svetunkov.ru
Snyder, R. D., 1985. Recursive Estimation of Dynamic Linear Models. Journal of the Royal Statistical Society, Series B (Methodological) 47 (2), 272-276.
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, Springer-Verlag. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-540-71918-2")}.
Kolassa, S. (2011) Combining exponential smoothing forecasts using Akaike weights. International Journal of Forecasting, 27, pp 238 - 251.
Taylor, J.W. and Bunn, D.W. (1999) A Quantile Regression Approach to Generating Prediction Intervals. Management Science, Vol 45, No 2, pp 225-237.
Lichtendahl Kenneth C., Jr., Grushka-Cockayne Yael, Winkler Robert L., (2013) Is It Better to Average Probabilities or Quantiles? Management Science 59(7):1594-1611. DOI: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1287/mnsc.1120.1667")}
es, auto.ssarima,
auto.ces, auto.gum, sma
## Not run: ourModel <- smoothCombine(BJsales,interval="p")
plot(ourModel)
## End(Not run)
# models parameter accepts either previously estimated smoothCombine
# or a manually formed list of smooth models estimated in sample:
## Not run: smoothCombine(BJsales,models=ourModel)
## Not run: models <- list(es(BJsales), sma(BJsales))
smoothCombine(BJsales,models=models)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.