Description Usage Arguments Details Value Author(s) References See Also Examples
Function constructs ETS model and returns forecast, fitted values, errors and matrix of states.
1 2 3 4 5 6 7 8 9  es(y, model = "ZZZ", persistence = NULL, phi = NULL,
initial = c("optimal", "backcasting"), initialSeason = NULL,
ic = c("AICc", "AIC", "BIC", "BICc"), loss = c("likelihood", "MSE",
"MAE", "HAM", "MSEh", "TMSE", "GTMSE", "MSCE"), h = 10, holdout = FALSE,
cumulative = FALSE, interval = c("none", "parametric", "likelihood",
"semiparametric", "nonparametric"), level = 0.95, bounds = c("usual",
"admissible", "none"), silent = c("all", "graph", "legend", "output",
"none"), xreg = NULL, xregDo = c("use", "select"), initialX = NULL,
...)

y 
Vector or ts object, containing data needed to be forecasted. 
model 
The type of ETS model. The first letter stands for the type of
the error term ("A" or "M"), the second (and sometimes the third as well) is for
the trend ("N", "A", "Ad", "M" or "Md"), and the last one is for the type of
seasonality ("N", "A" or "M"). So, the function accepts words with 3 or 4
characters: The parameter Also Keep in mind that model selection with "Z" components uses Branch and Bound algorithm and may skip some models that could have slightly smaller information criteria. 
persistence 
Persistence vector g, containing smoothing
parameters. If 
phi 
Value of damping parameter. If 
initial 
Can be either character or a vector of initial states. If it
is character, then it can be 
initialSeason 
Vector of initial values for seasonal components. If

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. 
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 
xregDo 
The variable defines what to do with the provided xreg:

initialX 
The vector of initial parameters for exogenous variables.
Ignored if 
... 
Other nondocumented parameters. For example 
Function estimates ETS in a form of the Single Source of Error state space model of the following type:
y_{t} = o_t (w(v_{tl}) + h(x_t, a_{t1}) + r(v_{tl}) ε_{t})
v_{t} = f(v_{tl}) + g(v_{tl}) ε_{t}
a_{t} = F_{X} a_{t1} + g_{X} ε_{t} / x_{t}
Where o_{t} is the Bernoulli distributed random variable (in case of
normal data it equals to 1 for all observations), v_{t} is the state
vector and l is the vector of lags, x_t is the vector of
exogenous variables. w(.) is the measurement function, r(.) is the error
function, f(.) is the transition function, g(.) is the persistence
function and h(.) is the explanatory variables function. a_t is the
vector of parameters for exogenous variables, F_{X} is the
transitionX
matrix and g_{X} is the persistenceX
matrix.
Finally, ε_{t} is the error term.
For the details see Hyndman et al.(2008).
For some more information about the model and its implementation, see the
vignette: vignette("es","smooth")
.
Also, there are posts about the functions of the package smooth on the website of Ivan Svetunkov: https://forecasting.svetunkov.ru/en/tag/smooth/  they explain the underlying models and how to use the functions.
Object of class "smooth" is returned. It contains the list of the following values for classical ETS models:
model
 type of constructed model.
formula
 mathematical formula, describing interactions between
components of es() and exogenous variables.
timeElapsed
 time elapsed for the construction of the model.
states
 matrix of the components of ETS.
persistence
 persistence vector. This is the place, where
smoothing parameters live.
phi
 value of damping parameter.
transition
 transition matrix of the model.
measurement
 measurement vector of the model.
initialType
 type of the initial values used.
initial
 initial values of the state vector (nonseasonal).
initialSeason
 initial values of the seasonal part of state vector.
nParam
 table with the number of estimated / provided parameters.
If a previous model was reused, then its initials are reused and the number of
provided parameters will take this into account.
fitted
 fitted values of ETS. In case of the intermittent model, the
fitted are multiplied by the probability of occurrence.
forecast
 the point forecast for h steps ahead (by default NA is returned). NOTE
that these do not always correspond to the conditional expectations. See ADAM
textbook, Section 4.4. for details (https://openforecast.org/adam/ETSTaxonomyMaths.html),
lower
 lower bound of prediction interval. When interval="none"
then NA is returned.
upper
 higher bound of prediction interval. When interval="none"
then NA is returned.
residuals
 residuals of the estimated model.
errors
 trace forecast insample errors, returned as a matrix. In the
case of trace forecasts this is the matrix used in optimisation. In nontrace estimations
it is returned just for the information.
s2
 variance of the residuals (taking degrees of freedom into account).
This is an unbiased estimate of variance.
interval
 type of interval asked by user.
level
 confidence level for interval.
cumulative
 whether the produced forecast was cumulative or not.
y
 original data.
holdout
 holdout part of the original data.
xreg
 provided vector or matrix of exogenous variables. If xregDo="s"
,
then this value will contain only selected exogenous variables.
initialX
 initial values for parameters of exogenous variables.
ICs
 values of information criteria of the model. Includes AIC, AICc, BIC and BICc.
logLik
 concentrated loglikelihood of the function.
lossValue
 loss function value.
loss
 type of loss function used in the estimation.
FI
 Fisher Information. Equal to NULL if FI=FALSE
or when FI
is not provided at all.
accuracy
 vector of accuracy measures for the holdout sample. In
case of nonintermittent data includes: MPE, MAPE, SMAPE, MASE, sMAE,
RelMAE, sMSE and Bias coefficient (based on complex numbers). In case of
intermittent data the set of errors will be: sMSE, sPIS, sCE (scaled
cumulative error) and Bias coefficient. This is available only when
holdout=TRUE
.
B
 the vector of all the estimated parameters.
If combination of forecasts is produced (using model="CCC"
), then a
shorter list of values is returned:
model
,
timeElapsed
,
initialType
,
fitted
,
forecast
,
lower
,
upper
,
residuals
,
s2
 variance of additive error of combined onestepahead forecasts,
interval
,
level
,
cumulative
,
y
,
holdout
,
ICs
 combined ic,
ICw
 ic weights used in the combination,
loss
,
xreg
,
accuracy
.
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), 272276.
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, SpringerVerlag. doi: 10.1007/9783540719182.
Svetunkov Ivan and Boylan John E. (2017). Multiplicative StateSpace Models for Intermittent Time Series. Working Paper of Department of Management Science, Lancaster University, 2017:4 , 143.
Teunter R., Syntetos A., Babai Z. (2011). Intermittent demand: Linking forecasting to inventory obsolescence. European Journal of Operational Research, 214, 606615.
Croston, J. (1972) Forecasting and stock control for intermittent demands. Operational Research Quarterly, 23(3), 289303.
Syntetos, A., Boylan J. (2005) The accuracy of intermittent demand estimates. International Journal of Forecasting, 21(2), 303314.
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 225237.
Lichtendahl Kenneth C., Jr., GrushkaCockayne Yael, Winkler Robert L., (2013) Is It Better to Average Probabilities or Quantiles? Management Science 59(7):15941611. DOI: doi: 10.1287/mnsc.1120.1667
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28  # See how holdout and trace parameters influence the forecast
es(Mcomp::M3$N1245$x,model="AAdN",h=8,holdout=FALSE,loss="MSE")
es(Mcomp::M3$N2568$x,model="MAM",h=18,holdout=TRUE,loss="TMSE")
# Model selection example
es(Mcomp::M3$N1245$x,model="ZZN",ic="AIC",h=8,holdout=FALSE,bounds="a")
# Model selection. Compare AICc of these two models:
es(Mcomp::M3$N1683$x,"ZZZ",h=10,holdout=TRUE)
es(Mcomp::M3$N1683$x,"MAdM",h=10,holdout=TRUE)
# Model selection, excluding multiplicative trend
es(Mcomp::M3$N1245$x,model="ZXZ",h=8,holdout=TRUE)
# Combination example
es(Mcomp::M3$N1245$x,model="CCN",h=8,holdout=TRUE)
# Model selection using a specified pool of models
ourModel < es(Mcomp::M3$N1587$x,model=c("ANN","AAM","AMdA"),h=18)
# Redo previous model and produce prediction interval
es(Mcomp::M3$N1587$x,model=ourModel,h=18,interval="p")
# Semiparametric interval example
es(Mcomp::M3$N1587$x,h=18,holdout=TRUE,interval="sp")
# This will be the same model as in previous line but estimated on new portion of data
es(Mcomp::M3[[1457]],model=ourModel,h=18,holdout=FALSE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.