SHAZAM Holt-Winters Exponential Smoothing

Holt-Winters Exponential Smoothing


Consider a time series with observed values X1, X2, ..., XN. The Holt-Winters exponential smoothing model estimates a trend (T) component and a smoothed value (S) by the estimating equations:

      St = AXt + (1-A)(St-1 + Tt-1)

      Tt = B(St - St-1) + (1-B)Tt-1

A and B are smoothing constants with values between 0 and 1. These values must be set by the user.

Forecasts are calculated as:

      XN+h = SN + h TN     for   h = 1, 2, 3, ...

The SHAZAM commands (filename: HOLTWINT.SHA) below use a data set from Newbold, [1995, Table 17.17, page 713]. The time series is an annual index of the amount of consumer credit outstanding. Following the example in Newbold, the smoothing constants are set to A=0.7 and B=0.6.

SAMPLE 1 11
READ X / BYVAR
   133  155  165  171  194  231  274  312  313  333  343 
GEN1 A=0.7
GEN1 B=0.6
DIM S 16 T 11
SAMPLE 2 2
GENR S=X
GENR T=X-LAG(X)
* Do the recursive computations
SET NODOECHO
DO #=3,11
SAMPLE # #
GENR S = A*X + (1-A)*(LAG(S)+LAG(T))
GENR T = B*(S-LAG(S)) + (1-B)*LAG(T)
ENDO
* Print the results 
SAMPLE 1 11
PRINT X S T 

* Forecasting
SAMPLE 12 16
GENR OBS=TIME(0)-11
GENR S = S:11 + OBS*T:11
PRINT OBS S
STOP

The SHAZAM output can be viewed.

The figure below gives a plot of the smoothed time series and some forecasts. The figure shows that the time series is characterized by an upward trend.

graph is placed here


Home [SHAZAM Guide home]

SHAZAM output


|_SAMPLE 1 11
|_READ X / BYVAR
   1 VARIABLES AND       11 OBSERVATIONS STARTING AT OBS       1

|_GEN1 A=0.7
|_GEN1 B=0.6
|_DIM S 16 T 11
|_SAMPLE 2 2
|_GENR S=X
|_GENR T=X-LAG(X)
|_* Do the recursive computations
|_SET NODOECHO
|_DO #=3,11
|_SAMPLE # #
|_GENR S = A*X + (1-A)*(LAG(S)+LAG(T))
|_GENR T = B*(S-LAG(S)) + (1-B)*LAG(T)
|_ENDO
****** EXECUTION BEGINNING FOR DO LOOP  # =       3
****** EXECUTION FINISHED FOR DO LOOP  #=      11
|_* Print the results
|_SAMPLE 1 11
|_PRINT X S T
      X              S              T
   133.0000      0.0000000      0.0000000
   155.0000       155.0000       22.00000
   165.0000       168.6000       16.96000
   171.0000       175.3680       10.84480
   194.0000       191.6638       14.11542
   231.0000       223.4338       24.70813
   274.0000       266.2426       35.56853
   312.0000       308.9433       39.84787
   313.0000       323.7374       24.81556
   333.0000       337.6659       18.28334
   343.0000       346.8848       12.84467

|_* Forecasting
|_SAMPLE 12 16
|_GENR OBS=TIME(0)-11
|_GENR S = S:11 + OBS*T:11
|_PRINT OBS S
      OBS            S
   1.000000       359.7294
   2.000000       372.5741
   3.000000       385.4188
   4.000000       398.2634
   5.000000       411.1081
|_STOP

Home [SHAZAM Guide home]