gum | R Documentation |
Function constructs Generalised Univariate Model, estimating matrices F, w, vector g and initial parameters.
gum(data, orders = c(1, 1), lags = c(1, frequency(data)),
type = c("additive", "multiplicative"), formula = NULL,
regressors = c("use", "select", "adapt", "integrate"),
initial = c("backcasting", "optimal", "complete"), persistence = NULL,
transition = NULL, measurement = rep(1, sum(orders)),
loss = c("likelihood", "MSE", "MAE", "HAM", "MSEh", "TMSE", "GTMSE",
"MSCE"), h = 0, holdout = FALSE, bounds = c("admissible", "none"),
silent = TRUE, model = NULL, ...)
auto.gum(data, orders = 3, lags = frequency(data), type = c("additive",
"multiplicative", "select"), formula = NULL, regressors = c("use",
"select", "adapt", "integrate"), initial = c("backcasting", "optimal",
"complete"), ic = c("AICc", "AIC", "BIC", "BICc"), loss = c("likelihood",
"MSE", "MAE", "HAM", "MSEh", "TMSE", "GTMSE", "MSCE"), h = 0,
holdout = FALSE, bounds = c("admissible", "none"), silent = TRUE, ...)
gum_old(data, orders = c(1, 1), lags = c(1, frequency(y)),
type = c("additive", "multiplicative"), persistence = NULL,
transition = NULL, measurement = rep(1, sum(orders)),
initial = c("optimal", "backcasting"), loss = c("likelihood", "MSE",
"MAE", "HAM", "MSEh", "TMSE", "GTMSE", "MSCE"), h = 10, holdout = FALSE,
bounds = c("restricted", "admissible", "none"), silent = c("all",
"graph", "legend", "output", "none"), ...)
ges(...)
data |
Vector, containing data needed to be forecasted. If a matrix (or
data.frame / data.table) is provided, then the first column is used as a
response variable, while the rest of the matrix is used as a set of explanatory
variables. |
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 |
formula |
Formula to use in case of explanatory variables. If |
regressors |
The variable defines what to do with the provided explanatory
variables:
|
initial |
Can be either character or a vector of initial states. If it
is character, then it can be |
persistence |
Persistence vector |
transition |
Transition matrix |
measurement |
Measurement vector |
loss |
The type of Loss Function used in optimization.
In case of LASSO / RIDGE, the variables are not normalised prior to the estimation, but the parameters are divided by the mean values of explanatory variables. Note that model selection and combination works properly only for the default
Furthermore, just for fun the absolute and half analogues of multistep estimators
are available: Last but not least, user can provide their own function here as well, making sure
that it accepts parameters
|
h |
The forecast horizon. Mainly needed for the multistep loss functions. |
holdout |
Logical. If |
bounds |
The type of bounds for the parameters to use in the model
estimation. Can be either |
silent |
Specifies, whether to provide the progress of the function or not.
If |
model |
A previously estimated GUM model, if provided, the function will not estimate anything and will use all its parameters. |
... |
Other non-documented parameters. See adam for
details. However, there are several unique parameters passed to the optimiser
in comparison with |
ic |
The information criterion to use in the model selection. |
The function estimates the Single Source of Error state space model of the following type:
y_{t} = w_t' v_{t-l} + \epsilon_{t}
v_{t} = F v_{t-l} + g_{t} \epsilon_{t}
where v_{t}
is the state vector (defined using orders
) and
l
is the vector of lags
, w_t
is the measurement
vector (which includes fixed elements and explanatory variables),
F
is the transition
matrix, g_t
is the persistence
vector (includes explanatory variables as well if provided), finally,
\epsilon_{t}
is the error term.
For some more information about the model and its implementation, see the
vignette: vignette("gum","smooth")
Object of class "adam" is returned with similar elements to the adam function.
Ivan Svetunkov, ivan@svetunkov.com
Svetunkov I. (2023) Smooth forecasting with the smooth package in R. arXiv:2301.01790. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2301.01790")}.
Svetunkov I. (2015 - Inf) "smooth" package for R - series of posts about the underlying models and how to use them: https://openforecast.org/category/r-en/smooth/.
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")}.
adam, es, ces
gum, es,
ces, sim.es, ssarima
gum(BJsales, h=8, holdout=TRUE)
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)
# 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 estimated 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")
x <- rnorm(50,100,3)
# The best GUM model for the data
ourModel <- auto.gum(x, orders=2, lags=4, h=18, holdout=TRUE)
summary(ourModel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.