`gum()`

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

In this vignette we will use data from `Mcomp`

package, so it is advised to install it.

Let’s load the necessary packages:

You may note that `Mcomp`

depends on `forecast`

package and if you load both `forecast`

and `smooth`

, then you will have a message that `forecast()`

function is masked from the environment. There is nothing to be worried about - `smooth`

uses this function for consistency purposes and has exactly the same original `forecast()`

as in the `forecast`

package. The inclusion of this function in `smooth`

was done only in order not to include `forecast`

in dependencies of the package.

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 monthly data N2457, we will have GUM\((1^1,1^{12})\):

```
## Time elapsed: 0.45 seconds
## Model estimated: GUM(1[1],1[12])
## Persistence vector g:
## [,1] [,2]
## [1,] 0.273 0.005
## Transition matrix F:
## [,1] [,2]
## [1,] 0.88 0.728
## [2,] 0.04 0.882
## Measurement vector w: 0.386, 0.079
## Initial values were optimised.
## 22 parameters were estimated in the process
## Residuals standard deviation: 1318.608
## Cost function type: MSE; Cost function value: 1738726.863
##
## Information criteria:
## AIC AICc BIC BICc
## 1713.034 1726.710 1769.678 1800.959
## Forecast errors:
## MPE: 22.5%; sCE: -1760.7%; Bias: 86.2%; MAPE: 38.1%
## MASE: 2.782; sMAE: 113.5%; sMSE: 221.7%; RelMAE: 1.188; RelRMSE: 1.306
```

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

```
## Time elapsed: 0.36 seconds
## Model estimated: GUM(2[1],1[12])
## Persistence vector g:
## [,1] [,2] [,3]
## [1,] 0.141 0.092 -0.075
## Transition matrix F:
## [,1] [,2] [,3]
## [1,] 0.571 0.234 0.095
## [2,] 0.253 0.683 0.064
## [3,] 0.118 0.109 0.958
## Measurement vector w: 0.745, 0.989, 0.992
## Initial values were optimised.
## 30 parameters were estimated in the process
## Residuals standard deviation: 1269.81
## Cost function type: MSE; Cost function value: 1612418.429
##
## Information criteria:
## AIC AICc BIC BICc
## 1721.719 1749.901 1798.960 1863.422
## Forecast errors:
## MPE: 24%; sCE: -1779.5%; Bias: 87.4%; MAPE: 37.9%
## MASE: 2.764; sMAE: 112.8%; sMSE: 214.9%; RelMAE: 1.181; RelRMSE: 1.286
```

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: 27.51 seconds
## Model estimated: GUM(1[1],1[4])
## Persistence vector g:
## [,1] [,2]
## [1,] 0.448 0.294
## Transition matrix F:
## [,1] [,2]
## [1,] 0.417 0.42
## [2,] 0.075 1.00
## Measurement vector w: 0.998, 1
## Initial values were produced using backcasting.
## 9 parameters were estimated in the process
## Residuals standard deviation: 1826.168
## Cost function type: MSE; Cost function value: 3334888.499
##
## Information criteria:
## AIC AICc BIC BICc
## 2071.650 2073.364 2096.354 2100.422
## 95% parametric prediction intervals were constructed
## 44% of values are in the prediction interval
## Forecast errors:
## MPE: -175.7%; sCE: 2148.6%; Bias: -89.7%; MAPE: 181.5%
## MASE: 3.224; sMAE: 132.2%; sMSE: 237.6%; RelMAE: 2.682; RelRMSE: 2.276
```

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(M3$N2457$x, h=18, holdout=TRUE, orders=c(2,1), lags=c(1,12), transition=transition, measurement=measurement)
```

```
## Time elapsed: 0.27 seconds
## Model estimated: GUM(2[1],1[12])
## Persistence vector g:
## [,1] [,2] [,3]
## [1,] 0.147 0.003 -0.025
## Transition matrix F:
## [,1] [,2] [,3]
## [1,] 1 1 0
## [2,] 0 1 0
## [3,] 0 0 1
## Measurement vector w: 1, 1, 1
## Initial values were optimised.
## 18 parameters were estimated in the process
## 12 parameters were provided
## Residuals standard deviation: 1339.166
## Cost function type: MSE; Cost function value: 1793364.893
##
## Information criteria:
## AIC AICc BIC BICc
## 1708.036 1716.805 1754.380 1774.439
## Forecast errors:
## MPE: 17.6%; sCE: -1554.8%; Bias: 78.8%; MAPE: 35.7%
## MASE: 2.58; sMAE: 105.3%; sMSE: 199.8%; RelMAE: 1.102; RelRMSE: 1.24
```

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.