Description Usage Arguments Details Value Author(s) References See Also Examples
Function constructs Generalised Univariate Model, estimating matrices F, w, vector g and initial parameters.
1 2 3 4 5 6 7 8 9 10 11 12  gum(y, orders = c(1, 1), lags = c(1, frequency(y)), type = c("additive",
"multiplicative"), persistence = NULL, transition = NULL,
measurement = NULL, initial = c("optimal", "backcasting"),
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("restricted", "admissible", "none"), silent = c("all",
"graph", "legend", "output", "none"), xreg = NULL, xregDo = c("use",
"select"), initialX = NULL, ...)
ges(...)

y 
Vector or ts object, containing data needed to be forecasted. 
orders 
Order of the model. Specified as vector of number of states
with different lags. For example, 
lags 
Defines lags for the corresponding orders. If, for example,

type 
Type of model. Can either be 
persistence 
Persistence vector g, containing smoothing
parameters. If 
transition 
Transition matrix F. Can be provided as a vector.
Matrix will be formed using the default 
measurement 
Measurement vector w. If 
initial 
Can be either character or a vector of initial states. If it
is character, then it 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. 
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 parameter

The function estimates the Single Source of Error state space model of the following type:
y_{t} = o_{t} (w' v_{tl} + x_t a_{t1} + ε_{t})
v_{t} = F v_{tl} + g ε_{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 equal to 1), v_{t} is the state vector (defined using
orders
) and l is the vector of lags
, x_t is the
vector of exogenous parameters. w is the measurement
vector,
F is the transition
matrix, g is the persistence
vector, 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 some more information about the model and its implementation, see the
vignette: vignette("gum","smooth")
Object of class "smooth" is returned. It contains:
model
 name of the estimated model.
timeElapsed
 time elapsed for the construction of the model.
states
 matrix of fuzzy components of GUM, where rows
correspond to time and cols
to states.
initialType
 Type of the initial values used.
initial
 initial values of state vector (extracted from
states
).
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.
measurement
 matrix w.
transition
 matrix F.
persistence
 persistence vector. This is the place, where
smoothing parameters live.
fitted
 fitted values.
forecast
 point forecast.
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
 the residuals of the estimated model.
errors
 matrix of 1 to h steps ahead errors.
s2
 variance of the residuals (taking degrees of freedom
into account).
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
 loglikelihood of the function.
lossValue
 Cost function value.
loss
 Type of loss function used in the estimation.
FI
 Fisher Information. Equal to NULL if FI=FALSE
or
when FI
variable 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.
Ivan Svetunkov, ivan@svetunkov.ru
Svetunkov I. (2015  Inf) "smooth" package for R  series of posts about the underlying models and how to use them: https://forecasting.svetunkov.ru/en/tag/smooth/.
Svetunkov I. (2017). Statistical models underlying functions of 'smooth' package for R. Working Paper of Department of Management Science, Lancaster University 2017:1, 152.
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  # Something simple:
gum(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,bounds="a",interval="p")
# A more complicated model with seasonality
ourModel < gum(rnorm(118,100,3),orders=c(2,1),lags=c(1,4),h=18,holdout=TRUE)
# Redo previous model on a new data and produce prediction interval
gum(rnorm(118,100,3),model=ourModel,h=18,interval="sp")
# Produce something crazy with optimal initials (not recommended)
gum(rnorm(118,100,3),orders=c(1,1,1),lags=c(1,3,5),h=18,holdout=TRUE,initial="o")
# Simpler model estiamted using trace forecast error loss function and its analytical analogue
gum(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,bounds="n",loss="TMSE")
gum(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,bounds="n",loss="aTMSE")
# Introduce exogenous variables
gum(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,xreg=c(1:118))
# Or select the most appropriate one
gum(rnorm(118,100,3),orders=c(1),lags=c(1),h=18,holdout=TRUE,xreg=c(1:118),xregDo="s")
summary(ourModel)
forecast(ourModel)
plot(forecast(ourModel))

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