ves | R Documentation |
Function constructs vector ETS model and returns forecast, fitted values, errors and matrix of states along with other useful variables.
ves(data, model = "PPP", lags = c(frequency(data)),
persistence = c("common", "individual", "dependent"),
transition = c("common", "individual", "dependent"), phi = c("common",
"individual"), initial = c("individual", "common"),
initialSeason = c("common", "individual"), loss = c("likelihood",
"diagonal", "trace"), ic = c("AICc", "AIC", "BIC", "BICc"), h = 10,
holdout = FALSE, occurrence = c("none", "fixed", "logistic"),
bounds = c("admissible", "usual", "none"), silent = TRUE, ...)
data |
The matrix with the data, where series are in columns and observations are in rows. |
model |
The type of ETS model. Can consist of 3 or 4 chars: Also |
lags |
The lags of the model. Needed for seasonal models. |
persistence |
Persistence matrix
You can also use the first letter instead of writing the full word. |
transition |
Transition matrix
You can also use the first letter instead of writing the full word. |
phi |
In cases of damped trend this parameter defines whether the |
initial |
Can be either character or a vector / matrix of initial states.
If it is character, then it can be |
initialSeason |
Can be either character or a vector / matrix of initial
states. Treated the same way as |
loss |
Type of Loss Function used in optimization.
An example of the latter option is:
|
ic |
The information criterion used in the model selection procedure. |
h |
Length of forecasting horizon. |
holdout |
If |
occurrence |
Defines type of occurrence model used. Can be:
In this case, the ETS model inside the occurrence part will correspond to
|
bounds |
What type of bounds to use in the model estimation. The first
letter can be used instead of the whole word. |
silent |
If |
... |
Other non-documented parameters. For example
|
Function estimates vector ETS in a form of the Single Source of Error state space model of the following type:
\mathbf{y}_{t} = (\mathbf{W} \mathbf{v}_{t-l} + \mathbf{x}_t
\mathbf{a}_{t-1} + \mathbf{\epsilon}_{t})
\mathbf{v}_{t} = \mathbf{F} \mathbf{v}_{t-l} + \mathbf{G}
\mathbf{\epsilon}_{t}
\mathbf{a}_{t} = \mathbf{F_{X}} \mathbf{a}_{t-1} + \mathbf{G_{X}}
\mathbf{\epsilon}_{t} / \mathbf{x}_{t}
Where y_{t}
is the vector of time series on observation t
,
\mathbf{v}_{t}
is the matrix of
states and l
is the matrix of lags, \mathbf{x}_t
is the vector of
exogenous variables. \mathbf{W}
is the measurement matrix, \mathbf{F}
is the transition matrix and \mathbf{G}
is the persistence matrix.
Finally, \epsilon_{t}
is the vector of error terms.
Conventionally we formulate values as:
\mathbf{y}'_t = (y_{1,t}, y_{2,t}, \dots, y_{m,t})
where m
is the number of series in the group.
\mathbf{v}'_t = (v_{1,t}, v_{2,t}, \dots, v_{m,t})
where v_{i,t}
is vector of components for i-th time series.
\mathbf{W}' = (w_{1}, \dots , 0;
\vdots , \ddots , \vdots;
0 , \vdots , w_{m})
is matrix of measurement vectors.
For the details on the additive model see Hyndman et al. (2008), chapter 17.
In case of multiplicative model, instead of the vector y_t we use its logarithms. As a result the multiplicative model is much easier to work with.
For some more information about the model and its implementation, see the
vignette: vignette("ves","legion")
Object of class "legion" is returned. It contains the following list of values:
model
- The name of the fitted model;
timeElapsed
- The time elapsed for the construction of the model;
states
- The matrix of states with components in columns and time in rows;
persistence
- The persistence matrix;
transition
- The transition matrix;
measurement
- The measurement matrix;
phi
- The damping parameter value;
lagsAll
- The vector of the internal lags used in the model;
B
- The vector of all the estimated coefficients;
initial
- The initial values of the non-seasonal components;
initialSeason
- The initial values of the seasonal components;
nParam
- The number of estimated parameters;
occurrence
- The occurrence part of the model estimated with VES;
data
- The matrix with the original data;
fitted
- The matrix of the fitted values;
holdout
- The matrix with the holdout values (if holdout=TRUE
in
the estimation);
residuals
- The matrix of the residuals of the model;
Sigma
- The covariance matrix of the errors (estimated with the correction
for the number of degrees of freedom);
forecast
- The matrix of point forecasts;
ICs
- The values of the information criteria;
logLik
- The log-likelihood function;
lossValue
- The value of the loss function;
loss
- The type of the used loss function;
lossFunction
- The loss function if the custom was used in the process;
accuracy
- the values of the error measures. Currently not available.
FI
- Fisher information if user asked for it using FI=TRUE
.
Ivan Svetunkov, ivan@svetunkov.com
de Silva A., Hyndman R.J. and Snyder, R.D. (2010). The vector innovations structural time series framework: a simple approach to multivariate forecasting. Statistical Modelling, 10 (4), pp.353-374
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, Springer-Verlag.
Lütkepohl, H. (2005). New Introduction to Multiple Time Series Analysis. New introduction to Multiple Time Series Analysis. Berlin, Heidelberg: Springer Berlin Heidelberg. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-540-27752-1")}
Svetunkov, I., Chen, H., & Boylan, J. E. (2023). A new taxonomy for vector exponential smoothing and its application to seasonal time series. European Journal of Operational Research, 304(3), 964–980. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ejor.2022.04.040")}
vets, es, adam
Y <- ts(cbind(rnorm(100,100,10),rnorm(100,75,8)),frequency=12)
# The simplest model applied to the data with the default values
ves(Y,model="ANN",h=10,holdout=TRUE)
# Damped trend model with the dependent persistence
ves(Y,model="AAdN",persistence="d",h=10,holdout=TRUE)
# Multiplicative damped trend model with individual phi
ves(Y,model="MMdM",persistence="i",h=10,holdout=TRUE,initialSeason="c")
# Automatic selection between pure models
ves(Y,model="PPP",persistence="i",h=10,holdout=TRUE,initialSeason="c")
# Intermittent demand vector model
Y <- cbind(c(rpois(25,0.1),rpois(25,0.5),rpois(25,1),rpois(25,5)),
c(rpois(25,0.1),rpois(25,0.5),rpois(25,1),rpois(25,5)))
ves(Y,model="MNN",h=10,holdout=TRUE,occurrence="l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.