Learn R Programming

smooth (version 4.3.0)

gum: Generalised Univariate Model

Description

Function constructs Generalised Univariate Model, estimating matrices F, w, vector g and initial parameters.

Usage

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(...)

Arguments

Value

Object of class "adam" is returned with similar elements to the adam function.

Details

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")

References

  • Svetunkov I. (2023) Smooth forecasting with the smooth package in R. arXiv:2301.01790. 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. 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. tools:::Rd_expr_doi("10.1007/978-3-540-71918-2").

See Also

adam, es, ces

gum, es, ces, sim.es, ssarima

Examples

Run this code
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)

Run the code above in your browser using DataLab