gum() - Generalised Univariate Model

Ivan Svetunkov

2025-07-01

gum() constructs Generalised Exponential Smoothing - pure additive state-space model. It is a part of smooth package.

Let’s load the necessary packages:

require(smooth)

Generalised Exponential Smoothing is a next step from CES. It is a state-space model in which all the matrices and vectors are estimated. It is very demanding in sample size, but is also insanely flexible.

A simple call by default constructs GUM\((1^1,1^m)\), where \(m\) is frequency of the data. So for our example with AirPassengers data, we will have GUM\((1^1,1^{12})\):

gum(AirPassengers, h=18, holdout=TRUE)
## Time elapsed: 0.08 seconds
## Model estimated using gum() function: GUM(1[1],1[12])
## With backcasting initialisation
## Distribution assumed in the model: Normal
## Loss function type: likelihood; Loss function value: 457.571
## Sample size: 126
## Number of estimated parameters: 7
## Number of degrees of freedom: 119
## Information criteria:
##      AIC     AICc      BIC     BICc 
## 929.1419 930.0911 948.9959 951.2911 
## 
## Forecast errors:
## ME: 13.799; MAE: 16.404; RMSE: 18.272
## sCE: 98.09%; Asymmetry: 90.6%; sMAE: 6.478%; sMSE: 0.521%
## MASE: 0.725; RMSSE: 0.626; rMAE: 0.261; rRMSE: 0.244

But some different orders and lags can be specified. For example:

gum(AirPassengers, h=18, holdout=TRUE, orders=c(2,1), lags=c(1,12))
## Time elapsed: 0.13 seconds
## Model estimated using gum() function: GUM(2[1],1[12])
## With backcasting initialisation
## Distribution assumed in the model: Normal
## Loss function type: likelihood; Loss function value: 476.0205
## Sample size: 126
## Number of estimated parameters: 13
## Number of degrees of freedom: 113
## Information criteria:
##      AIC     AICc      BIC     BICc 
##  978.041  981.291 1014.913 1022.772 
## 
## Forecast errors:
## ME: 30.555; MAE: 31.936; RMSE: 34.291
## sCE: 217.203%; Asymmetry: 95.3%; sMAE: 12.612%; sMSE: 1.834%
## MASE: 1.412; RMSSE: 1.175; rMAE: 0.509; rRMSE: 0.458

Function auto.gum() is now implemented in smooth, but it works slowly as it needs to check a large number of models:

auto.gum(AirPassengers, silent=FALSE)
## Starting preliminary loop:            1 out of 122 out of 123 out of 124 out of 125 out of 126 out of 127 out of 128 out of 129 out of 1210 out of 1211 out of 1212 out of 12. Done.
## Searching for appropriate lags:  —\|/—\|/—\|/We found them!
## Searching for appropriate orders:  —\|/—\|/—Orders found.
## Reestimating the model. Done!
## Time elapsed: 4.28 seconds
## Model estimated using gum() function: GUM(1[1],3[12])
## With backcasting initialisation
## Distribution assumed in the model: Normal
## Loss function type: likelihood; Loss function value: 527.6646
## Sample size: 144
## Number of estimated parameters: 21
## Number of degrees of freedom: 123
## Information criteria:
##      AIC     AICc      BIC     BICc 
## 1097.329 1104.903 1159.695 1178.515

In addition to standard values that other functions accept, GUM accepts predefined values for transition matrix, measurement and persistence vectors. For example, something more common can be passed to the function:

    transition <- matrix(c(1,0,0,1,1,0,0,0,1),3,3)
    measurement <- c(1,1,1)
    gum(AirPassengers, h=18, holdout=TRUE, orders=c(2,1), lags=c(1,12), transition=transition, measurement=measurement)
## Time elapsed: 0.04 seconds
## Model estimated using gum() function: GUM(2[1],1[12])
## With backcasting initialisation
## Distribution assumed in the model: Normal
## Loss function type: likelihood; Loss function value: 487.9629
## Sample size: 126
## Number of estimated parameters: 4
## Number of degrees of freedom: 122
## Information criteria:
##      AIC     AICc      BIC     BICc 
## 983.9259 984.2564 995.2710 996.0704 
## 
## Forecast errors:
## ME: 28.373; MAE: 30.154; RMSE: 32.344
## sCE: 201.693%; Asymmetry: 94.5%; sMAE: 11.908%; sMSE: 1.632%
## MASE: 1.333; RMSSE: 1.108; rMAE: 0.48; rRMSE: 0.432

The resulting model will be equivalent to ETS(A,A,A). However due to different initialisation of optimisers and different method of number of parameters calculation, gum() above and es(y, "AAA", h=h, holdout=TRUE) will lead to different models.