gum() constructs Generalised Exponential
Smoothing - pure additive state-space model. It is a part of smooth package.
Let’s load the necessary packages:
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})\):
## Time elapsed: 0.04 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: 470.1121
## Sample size: 126
## Number of estimated parameters: 20
## Number of degrees of freedom: 106
## Information criteria:
## AIC AICc BIC BICc
## 980.2243 988.2243 1036.9499 1056.2950
##
## Forecast errors:
## ME: 4.799; MAE: 14.737; RMSE: 18.954
## sCE: 34.112%; Asymmetry: 35.6%; sMAE: 5.82%; sMSE: 0.56%
## MASE: 0.651; RMSSE: 0.649; rMAE: 0.235; rRMSE: 0.253
But some different orders and lags can be specified. For example:
## Time elapsed: 0.08 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: 506.4177
## Sample size: 126
## Number of estimated parameters: 27
## Number of degrees of freedom: 99
## Information criteria:
## AIC AICc BIC BICc
## 1066.835 1082.264 1143.415 1180.724
##
## Forecast errors:
## ME: 47.654; MAE: 51.297; RMSE: 64.31
## sCE: 338.75%; Asymmetry: 90.3%; sMAE: 20.258%; sMSE: 6.45%
## MASE: 2.267; RMSSE: 2.203; rMAE: 0.817; rRMSE: 0.859
Function auto.gum() is now implemented in
smooth, but it works slowly as it needs to check a large
number of models:
## 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: 2.68 seconds
## Model estimated using gum() function: GUM(2[1],2[12])
## With backcasting initialisation
## Distribution assumed in the model: Normal
## Loss function type: likelihood; Loss function value: 549.2983
## Sample size: 144
## Number of estimated parameters: 47
## Number of degrees of freedom: 97
## Information criteria:
## AIC AICc BIC BICc
## 1192.597 1239.597 1332.178 1448.968
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.03 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: 483.2083
## Sample size: 126
## Number of estimated parameters: 18
## Number of degrees of freedom: 108
## Information criteria:
## AIC AICc BIC BICc
## 1002.417 1008.809 1053.470 1068.928
##
## Forecast errors:
## ME: 28.682; MAE: 30.498; RMSE: 32.728
## sCE: 203.891%; Asymmetry: 94.5%; sMAE: 12.044%; sMSE: 1.671%
## MASE: 1.348; RMSSE: 1.121; rMAE: 0.486; rRMSE: 0.437
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.