gum | R Documentation |
Function constructs Generalised Univariate Model, estimating matrices F, w, vector g and initial parameters.
gum(y, orders = c(1, 1), lags = c(1, frequency(y)), type = c("additive",
"multiplicative"), initial = c("backcasting", "optimal", "two-stage",
"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,
xreg = NULL, regressors = c("use", "select", "adapt", "integrate"),
initialX = NULL, ...)
auto.gum(y, orders = 3, lags = frequency(y), type = c("additive",
"multiplicative", "select"), initial = c("backcasting", "optimal",
"two-stage", "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, xreg = NULL, regressors = c("use", "select", "adapt",
"integrate"), ...)
gum_old(y, 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"), xreg = NULL, regressors = 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 |
initial |
Can be either character or a list, 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. 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 |
bounds |
The type of bounds for the parameters to use in the model
estimation. Can be either |
silent |
accepts |
model |
A previously estimated GUM model, if provided, the function will not estimate anything and will use all its parameters. |
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 |
... |
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 used in the model selection procedure. |
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/.
Svetunkov, I., 2023. Smooth Forecasting with the Smooth Package in R. arXiv. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2301.01790")}
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.