SHAZAM Simple Exponential Smoothing

Simple Exponential Smoothing


With the choice of a smoothing constant, a smoothed series can be generated by exponential smoothing. The smoothed value calculated for the final period can then be used as the forecast of future values.

Newbold [1995, pp. 711-712] discusses that some judgement is required in the selection of a smoothing constant. A recommendation is to try several different values and select a value that minimizes the sum of squared forecast errors.

The SHAZAM commands (filename: ESMOOTH.SHA) below use the data set on annual sales (in thousands of dollars) of Lydia E. Pinkham from 1931 to 1960. This data set was used in a previous example. A SHAZAM procedure (the set of commands between the PROC and PROCEND commands) uses the SMOOTH command to calculate a smoothed series by exponential smoothing. The smoothed series is saved with the EMAVE= option. Forecast errors are obtained and the sum of squared forecast errors is then calculated.

SAMPLE 1 30
* Read the sales data
READ SALES / BYVAR
 1806  1644  1814  1770  1518  1103  1266  1473  1423  1767
 2161  2336  2602  2518  2637  2177  1920  1910  1984  1787
 1689  1866  1896  1684  1633  1657  1569  1390  1387  1289

PROC EXPSMTH
  SAMPLE 1 30
  SMOOTH SALES / WEIGHT=W EMAVE=S
  SAMPLE 2 30
* Generate 1-step ahead predictions
  GENR PREDICT=LAG(S)
* Generate forecast errors
  GENR E=SALES-PREDICT
* Calculate the sum of squared forecast errors
  STAT E / CP=SSE
  PRINT W SSE
PROCEND

SET NOOUTPUT NODOECHO
* Try several different smoothing constants.
GEN1 W=0.8
EXEC EXPSMTH
GEN1 W=0.6
EXEC EXPSMTH
GEN1 W=0.4
EXEC EXPSMTH
GEN1 W=0.2
EXEC EXPSMTH
STOP

The EXEC command executes the SHAZAM procedure commands for values of the smoothing constant, w, of 0.8, 0.6, 0.4 and 0.2.

The SHAZAM output can be viewed. The results are summarized in the table below. Note that the value in the column 1-w is the Newbold definition for the smoothing constant.

w 1-w Sum of Squared
Forecast Errors
    0.8         0.2     1,405,769
0.6 0.4 1,761,367
0.4 0.6 2,421,086
0.2 0.8 3,570,107

The results show that the sum of squared forecast errors is smallest for w=0.8.


Comparison with ARIMA modelling

Mills [1990, pp. 154-5] discusses that simple exponential smoothing has an interpretation as the ARIMA(0,1,1) model:

      (Xt - Xt-1) = et - Aet-1

where et is a random error.

Forecasts are calculated as:

      XN+h = XN - a êN     for   h = 1, 2, 3, ...

where a is the estimate of A and ê is the observed residual.

The SHAZAM commands (filename: EARIMA.SHA) for the ARIMA estimation and forecasting are given below.

SAMPLE 1 30
* Read the sales data
READ SALES / BYVAR
 1806  1644  1814  1770  1518  1103  1266  1473  1423  1767
 2161  2336  2602  2518  2637  2177  1920  1910  1984  1787
 1689  1866  1896  1684  1633  1657  1569  1390  1387  1289
* Estimate an ARIMA(0,1,1) model
ARIMA SALES / NDIFF=1 NMA=1 NOCONSTANT COEF=ALPHA
GEN1 S=SQRT($SIG2)    
* Forecasting
ARIMA SALES / NDIFF=1 NMA=1 NOCONSTANT COEF=ALPHA SIGMA=S FBEG=30 FEND=34   
STOP

The SHAZAM output can be viewed. The ARIMA estimation results show that the estimate of the smoothing parameter A is -0.3. This estimate is not in the [0,1] range that describes the exponential smoothing method.


Home [SHAZAM Guide home]

SHAZAM output - Simple Exponential Smoothing


|_SAMPLE 1 30
|_* Read the sales data
|_READ SALES / BYVAR
   1 VARIABLES AND       30 OBSERVATIONS STARTING AT OBS       1

|_PROC EXPSMTH
|_  SAMPLE 1 30
|_  SMOOTH SALES / WEIGHT=W EMAVE=S
|_  SAMPLE 2 30
|_* Generate 1-step ahead predictions
|_  GENR PREDICT=LAG(S)
|_* Generate forecast errors
|_  GENR E=SALES-PREDICT
|_* Calculate the sum of squared forecast errors
|_  STAT E / CP=SSE
|_  PRINT W SSE
|_PROCEND
|_SET NOOUTPUT NODOECHO
|_* Try several different smoothing constants.
|_GEN1 W=0.8
|_EXEC EXPSMTH
    W
  0.8000000
    SSE
   1405769.
|_GEN1 W=0.6
|_EXEC EXPSMTH
    W
  0.6000000
    SSE
   1761367.
|_GEN1 W=0.4
|_EXEC EXPSMTH
    W
  0.4000000
    SSE
   2421086.
|_GEN1 W=0.2
|_EXEC EXPSMTH
    W
  0.2000000
    SSE
   3570107.
|_STOP

Home [SHAZAM Guide home]

SHAZAM output - ARIMA estimation and forecasting


|_SAMPLE 1 30
|_* Read the sales data
|_READ SALES / BYVAR
   1 VARIABLES AND       30 OBSERVATIONS STARTING AT OBS       1

|_* Estimate an ARIMA(0,1,1) model

|_ARIMA SALES / NDIFF=1 NMA=1 NOCONSTANT COEF=ALPHA
    ARIMA MODEL
NUMBER OF OBSERVATIONS =  30
...NOTE..SAMPLE RANGE SET TO:     1,    30
DEGREE OF DIFFERENCING =   1
NUMBER OF MA PARAMETERS =   1
NO CONSTANT TERM IS IN THE MODEL

ESTIMATION PROCEDURE
STARTING VALUES OF PARAMETERS ARE:
 0.50000

MEAN OF SERIES =  -17.83
VARIANCE OF SERIES =  0.4332E+05
STANDARD DEVIATION OF SERIES =   208.1

INITIAL SUM OF SQUARES =      2036201.0

ITERATION STOPS - RELATIVE CHANGE IN SUM OF SQUARESLESS THAN 0.1E-05

NET NUMBER OF OBS IS   29
DIFFERENCING: 1 CONSECUTIVE, 0 SEASONAL WITH SPAN  0
CONVERGENCE AFTER 14 ITERATIONS
INITIAL SUM OF SQS=     2036201.0         FINAL SUM OF SQS=     1128563.6

 R-SQUARE =  0.0697     R-SQUARE ADJUSTED =  0.0364
VARIANCE OF THE ESTIMATE-SIGMA**2 =   40157.
STANDARD ERROR OF THE ESTIMATE-SIGMA =   200.39
AKAIKE INFORMATION CRITERIA -AIC(K) =   10.670
SCHWARZ CRITERIA- SC(K) =   10.717

             PARAMETER ESTIMATES        STD ERROR     T-STAT
              MA( 1)  -0.30132         0.1760         -1.712

                               RESIDUALS
  LAGS                      AUTOCORRELATIONS                          STD ERR
  1 -12    -.02 -.01 0.05 0.15 -.25 -.37 0.01 0.06 -.25 0.12 0.12 0.19   0.19
 13 -24    -.29 0.10 0.07 -.05 -.21 0.04 0.07 -.10 -.04 0.08 -.01 0.01   0.24
 25 -28    -.01 0.04 -.03 0.01                                           0.27

 MODIFIED BOX-PIERCE (LJUNG-BOX-PIERCE) STATISTICS  (CHI-SQUARE)
    LAG    Q    DF  P-VALUE       LAG    Q    DF  P-VALUE
     2    0.01   1  .910          15   20.41  14  .118
     3    0.10   2  .953          16   20.60  15  .150
     4    0.96   3  .812          17   23.90  16  .092
     5    3.38   4  .496          18   24.01  17  .119
     6    8.74   5  .120          19   24.48  18  .140
     7    8.75   6  .188          20   25.46  19  .146
     8    8.90   7  .260          21   25.66  20  .177
     9   11.64   8  .168          22   26.52  21  .187
    10   12.33   9  .195          23   26.52  22  .230
    11   13.09  10  .218          24   26.54  23  .276
    12   14.92  11  .186          25   26.55  24  .326
    13   19.49  12  .077          26   26.92  25  .360
    14   20.08  13  .093          27   27.23  26  .398
                                  28   27.34  27  .446

CROSS-CORRELATIONS BETWEEN RESIDUALS AND (DIFFERENCED) SERIES

CROSS-CORRELATION AT ZERO LAG = 0.94
  LAGS                    CROSS CORRELATIONS Y(T),E(T-K)
  1-12    0.27 -.01 0.04 0.16 -.20 -.42 -.10 0.06 -.21 0.04 0.15 0.21
 13-24    -.22 0.01 0.08 -.03 -.22 -.02 0.08 -.07 -.06 0.06 0.02 0.01
 25-28    -.01 0.03 -.02 0.01
 LEADS                    CROSS CORRELATIONS Y(T),E(T+K)
  1-12    -.02 0.00 0.09 0.08 -.35 -.35 0.03 -.02 -.20 0.15 0.17 0.10
 13-24    -.24 0.12 0.05 -.11 -.19 0.06 0.04 -.11 -.02 0.08 0.00 0.01
 25-28    0.01 0.03 -.02 0.01

              ANALYSIS OF RESIDUALS
              VALUES RANGE FROM    -510.0205 TO     370.5252

   SAMPLE MOMENTS OF RESIDUALS (USING THE DIVISOR  29) :
   MEAN =               -14.06923
   VARIANCE =            38574.70
   SKEWNESS =          -0.1833068
   KURTOSIS =            2.893125
   STUDENTIZED RANGE =   4.483329

|_GEN1 S=SQRT($SIG2)
..NOTE..CURRENT VALUE OF $SIG2=   40157.

|_* Forecasting

|_ARIMA SALES / NDIFF=1 NMA=1 NOCONSTANT COEF=ALPHA SIGMA=S FBEG=30 FEND=34
    ARIMA MODEL
NUMBER OF OBSERVATIONS =  30
...NOTE..SAMPLE RANGE SET TO:     1,    30
DEGREE OF DIFFERENCING =   1
NUMBER OF MA PARAMETERS =   1
NO CONSTANT TERM IS IN THE MODEL

    ARIMA FORECAST
          PARAMETER VALUES ARE:
               MA( 1)=  -0.30132

FROM ORIGIN DATE  30, FORECASTS ARE CALCULATED UP TO    4 STEPS AHEAD

FUTURE DATE   LOWER      FORECAST       UPPER       ACTUAL       ERROR
     31      862.852      1255.62      1648.39
     32      611.019      1255.62      1900.23
     33      432.969      1255.62      2078.28
     34      287.117      1255.62      2224.13

     STEPS AHEAD    STD ERROR     PSI WT
           1         200.4        1.0000
           2         328.9        1.3013
           3         419.7        1.3013
           4         494.1        1.3013

VARIANCE OF ONE-STEP-AHEAD ERRORS-SIGMA**2 =  0.4016E+05
STD.DEV. OF ONE-STEP-AHEAD ERRORS-SIGMA    =   200.4
|_STOP

Home [SHAZAM Guide home]