**Have a Question?**

**Phone:** +1 (888) 427-9486

+1 (312) 257-3777

Contact Us

# GESMTH

Returns the general-form exponential smoothing (out-of-sample) forecast estimate.

## Syntax

**GESMTH**(

**X**,

**Order**,

**Alpha**,

**Beta**,

**Gamma**,

**Phi**,

**Lambda**,

**Trend Type**,

**Seasonality Type**,

**L**,

**Optimize**,

**Adjust**,

**Log**,

**T**,

**Return Type**)

**X**

is the univariate time series data (a one-dimensional array of cells (e.g. rows or columns)).

**Order**

is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).

Order | Description |
---|---|

1 | ascending (the first data point corresponds to the earliest date) (default) |

0 | descending (the first data point corresponds to the latest date) |

**Alpha**

is the level smoothing factor (alpha should be between zero(0) and one(1) (exclusive)). If missing or omitted, 0.333 value is used.

**Beta**

is the trend smoothing factor (beta should be between zero(0) and one(1) (exclusive)). If missing or omitted, 0.333 value is used.

**Gamma**

is the seasonal change smoothing factor (gamma should be between zero(0) and One(1) (exclusive)). If missing or omitted, 0.50 value is used.

**Phi**

is the damping coefficient of the (Pegel) trend component (phi should be between zero(0) and one(1) (inclusive)). If missing or omitted, 1.0 value is used.

**Lambda**

is the coefficient value for the residuals autocorrelation adjustment term (lambda should be between negative one(-1) and one(1) (exclusive)). If missing or omitted, 0 value is used.

**Trend Type**

is a number that specify the trend component in the model: 0 (or missing) =None, 1=Additive, 2=Additive damped, 3=Multiplicative, 4=Multiplicative damped trend.

Value | Description |
---|---|

0 | None (default) |

1 | Additive trend (default) |

2 | Additive damped trend |

3 | Multiplicative trend |

4 | Multiplicative damped trend |

**Seasonality Type**

is a number that specify the seasonality component in the model: 0 (or missing) =None, 1= Additive Seasonality, 2=Multiplicative Seasonality.

Value | Description |
---|---|

0 | None (default) |

1 | Additive seasonality |

2 | Multiplicative seasonality |

**L**

is the season Length or duration in units of steps.

**Optimize**

is a flag (True/False) for searching and using optimal value of the smoothing factor. If missing or omitted, optimize is assumed False.

**Adjust**

is a flag (True/False) for adjusting for the autocorrelation (Chatfield) in forecast errors. If missing or omitted, Adjust is assumed False.

**Log**

Is a flag (True/False) for taking the natural logarithm of the input data prior to smoothing. If missing or omitted, Log is assumed False.

**T**

is the forecast time/horizon beyond the end of X. If missing, a default value of 0 (Latest or end of X) is assumed.

**Return Type**is a number that determines the type of return value:0(or missing)=Forecast,1=Alpha,2=Beta,3=Gamma,4=phi,5=lambda,6=level component(series),7=trend component(series),8=seasonal component(series),9=adjustments (series),10=one-step forecasts(series).

Return Type | Description |
---|---|

0 or omitted | Forecast value |

1 | Level smoothing parameter (alpha) |

2 | Trend smoothing parameter (beta) |

3 | Seaonal smoothing parameter (gamma) |

4 | damping coefficient (phi) |

5 | autocorrelation correction coefficient (lambda) |

6 | level component (series) |

7 | trend component (series) |

8 | seasonal component (series) |

9 | error autocorrelation (Chatfield) adjustment component (series) |

10 | one-step forecasts (series) |

## Remarks

- The time series is homogeneous or equally spaced.
- The time series may include missing values (e.g. #N/A) at either end.
- The GESMTH is a generalization of the triple exponential smoothing model. The recursive form of the single-seasonality general exponential smoothing equation is expressed as follows:

- The functional form of are defined by the type of the trend in the model:

No Trend Additive Trend Damped Additive Trend Multiplicative Trend Damped Multiplicative Trend - The functional form of and are defined by the type of the seasonality type:

No Seasonality Additive Seasonality Multiplicative Seasonality - The functional form of the m-step (out-of-sample) forecast () is determined by the trend type and the seasonality type:

No Seasonality Additive Multiplicative No Trend Additive Trend Damped Additive Trend Multiplicative Trend Damped Multiplicative Trend - The last term in the forecast function ()is the forecast error 1st order autocorrelation adjustment term (),but this remains the same for all trend and seasonality types.
- In sum, the GESMTH function captures the 15-different models for the single seasonality exponential smoothing, and the Bown’s simple exponential, holt’s double exponential and Holt-Winters triple exponential are merely 3-special cases in GESMTH.
- The (damped) multiplicative trend can only be used with positive valued input time series.
- The three components equations in GESMTH are interdependent in sense that three components must be updated each period
- Similar to Holt-Winters smoothing, the smoothing coefficient is again used to control speed of adaptation to local level, a second smoothing constant is used to control the degree of a local trend, a third smoothing constant is introduced to control the degree of local seasonal Indices, and finally, a fourth constant to dampen the trend carried through to multi-step-ahead forecast periods.
- The GESMTH calculate a point forecast. There is no probabilistic model assumed for the simple exponential smoothing, so we can’t derive a statistical confidence interval for the computed values.
- In practice, the Mean Squared Error (MSE) for prior out-of-sample forecast values are often used as a proxy for the uncertainty (i.e. variance) in the most recent forecast value.
- Similar to other recursive exponential smoothing models, the GESMTH method requires a set of starting values. The nature of value and how we calculate them depend on the specified trend and seasonality types
- For non-seasonal time series (Seasonality type = None), we need starting value for level () and trend (), if trend is chosen. The calculation of the initial value depends on the trend type (none, vs. additive vs. multiplicative).
- For seasonal time series (additive and multiplicative), we need starting values for the seasonal indices (), initial level (), and initial trend (), if trend is chosen.
- The actual calculation of the initial values can be summarized in 3 steps
- Seasonally-adjust the data to estimate trend series.
- Detrend the data to estimate the seasonal indices.
- Average over multiple seasons to improve the estimate.

- Starting from NumXL version 1.65, the GESMTH has a built-in optimizer to find the best value of (, and ) that minimize the SSE (loss function ()) for the one-step forecast calculated in-sample.

- For initial values, the NumXL optimizer will use the input value of (, and ) (if available) in the minimization problem, and the initial values for the level, trend and seasonal indices series () are computed from the input data.
- The GESMTH function return the found optimal value for , and , and the corresponding one-step smoothing series of level, trend, seasonal indices, adjustment terms and the one-step (in-sample) forecast series.
- For seasonal model, the input time series must have at least two full seasons of observations to use the built-in optimizer.
- NumXL implements the spectral projected gradient (SPG) method for finding the minima with a boxed boundary
- The SPG requires loss function value and the gradient (). NumXL implements the exact derivative formula (vs. numerical approximation) for performance purposes.

- Internally, during the optimization, NumXL computes recursively both the smoothed time series, levels, trends, seasonal indices and all the in-sample derivatives, which are used for the loss function and its derivative.
- The SPG is an iterative (recursive) method, and it is possible that the minima can’t be found the within allowed number of iterations and/or tolerance. In this case, NumXL will not fail, instead NumXL uses the best alpha found so far.
- The SPG has no provision to detect or avoid local minima trap. There is no guarantee of global minima.

- The SPG requires loss function value and the gradient (). NumXL implements the exact derivative formula (vs. numerical approximation) for performance purposes.
- In general, the SSE function in GESMTH yields a continuous smooth non-monotone curve, that SPG minimizer almost always finds an optimal solution in a very few iterations
- The GMSE function is available starting with version 1.65 HAMMOCK.

## References

- James Douglas Hamilton; Time Series Analysis; Princeton University Press; 1st edition(Jan 11, 1994), ISBN: 691042896
- Tsay, Ruey S.; Analysis of Financial Time Series; John Wiley & SONS; 2nd edition(Aug 30, 2005), ISBN: 0-471-690740
- D. S.G. Pollock; Handbook of Time Series Analysis, Signal Processing, and Dynamics; Academic Press; Har/Cdr edition(Nov 17, 1999), ISBN: 125609906