You are on page 1of 4

30/05/12

Forecasting with seasonal adjustment and linear exponential smoothing

Spreadsheet implementation of seasonal adjustment and exponential smoothing

It is straightforward to perform seasonal adjustment and fit exponential smoothing models using a spreadsheet program such as Excel. The screen images and charts belo spreadsheet which has been set up to illustrate multiplicative seasonal adjustment and linear exponential smoothing on the Outboard Marine data from your textbook. To spreadsheet file itself, click here.

The forecasting process proceeds as follows: (i) first the data are seasonally adjusted; (ii) then forecasts are generated for the seasonally adjusted data via linear expo finally the seasonally adjusted forecasts are "reseasonalized" to obtain forecasts for the original series. The seasonal adjustment process is carried out in the first six col

The first step in seasonal adjustment is to compute a centered moving average (performed here in column C). This can be done by simply taking the average of two one offset by one period relative to each other. The next step is to compute the ratio to moving average--i.e., the original data divided by the moving average in each perio column D. The estimated seasonal index for each season is computed by first averaging all the ratios for that particular season, and then renormalizing the ratios if neces exactly 100% times the number of periods in a season, or 400% in this case. (This is done in the first few rows of columns E and F. There are more elegant ways to ave this case the number of rows is small, I just manually typed the row numbers for all the "June" ratios inside the AVERAGE( ) formula in cell D10, and then I copied this for not hard to count by 4's--or by 12's if your data is monthly--until you've reached the bottom of the data set. Note that you do NOT copy the seasonal index formula int same column--you just replicate it enough times to compute the seasonal index once for each season in the year. Then, in the remainder of the cells in the column, you to the seasonal index used in the same season in the preceding year.) The seasonally adjusted data is obtained by dividing the original data by the column of seasonal in B by column E). The centered moving average and the seasonally adjusted data end up looking like this:

Note that the moving average typically looks like a smoothed version of the seasonally adjusted series.

The same spreadsheet also shows the application of the linear exponential smoothing model to the seasonally adjusted data, beginning in column G.

www.duke.edu/~rnau/411outbd.htm

1/4

30/05/12

Forecasting with seasonal adjustment and linear exponential smoothing

A value for the smoothing constant (alpha) is entered above the forecast column (here, in cell G9) and for convenience it is assigned the range name "Alpha." (The name "Insert/Name/Create" command.) The LES model is initialized by setting the first two forecasts equal to the first actual value of the seasonally adjusted series. The formu forecast is the recursive form of the forecasting equation, namely (t) = 2Y(t-1) - Y(t-2) - 2(1- )e(t-1) + ((1- )^2)e(t-2)

This formula is entered in the cell corresponding to the third period (here, cell G15) and copied down from there. Notice that the LES forecast for the current period refer observations and the two preceding forecast errors, as well as to the value of alpha. Thus, the forecasting formula in row 15 refers only to data which were available in course, if we wished to use simple instead of linear exponential smoothing, we could substitute the SES formula here instead.)

The errors are computed in the next column (here, column H) by subtracting the forecasts from the actual values. The root mean squared error is computed as the sq the errors plus the square of the mean. (This follows from the mathematical identity: MSE= VARIANCE(errors)+ (AVERAGE(errors))^2.) In calculating the mean and varian formula, the first two periods are excluded because the model does not actually begin forecasting until the third period (row 15 on the spreadsheet). The optimal value o manually changing alpha until the minimum RMSE is found, or else you can use the "Solver" to perform an exact minimization. The value of alpha that the Solver found is

It is usually a good idea to plot the errors of the model (in transformed units) and also to compute and plot their autocorrelations at lags up to one season. Here is a tim adjusted) errors:

The error autocorrelations are computed by using the CORREL( ) function to compute the correlations of the errors with themselves lagged by one or more periods--deta spreadsheet model. Here is a plot of the autocorrelations of the errors at the first five lags:

www.duke.edu/~rnau/411outbd.htm

2/4

30/05/12

Forecasting with seasonal adjustment and linear exponential smoothing

The spike at lag 4 is slightly troublesome--it suggests that the seasonal adjustment process has not been completely successful. However, it is actually only marginally s limits for autocorrelations are roughly plus-or-minus-2-over-the-square-root-of-n, where n is the sample size. Here the sample size for the autocorrelations varies from 3 so the square-root-of-n is about 6, and hence the confidence limits are roughly plus-or-minus 2/6, or 0.33. If you vary the value of alpha by hand, you can observe the autocorrelation plots of the errors, as well as on the mean squared error.

At the bottom of the spreadsheet, the forecasting formula is "bootstrapped" into the future by merely substituting forecasts for actual values at the point where the act "the future" begins. (In other words, in each cell where a future data value would occur, a cell reference is inserted which points to the forecast made for that period.) A simply copied down from above:

Notice that the errors for forecasts of the future are all computed to be zero. This does not mean the actual errors will be zero, but rather it merely reflects the fact th we are assuming that the future data will equal the forecasts. The resulting LES forecasts for the seasonally adjusted data look like this:

Note that with this particular value of alpha--the "optimal" value for one-step-ahead prediction--the projected trend is slightly upward, reflecting the local trend that wa years or so. For other values of alpha, a different trend projection might be obtained.

The final step in building the forecasting model is to "reasonalize" the LES forecasts by multiplying them by the appropriate seasonal indices. Thus, the reseasonalized for the product of the seasonal indices in column E and the seasonally adjusted LES forecasts in column G.

www.duke.edu/~rnau/411outbd.htm

3/4

30/05/12

Forecasting with seasonal adjustment and linear exponential smoothing

It is relatively easy to compute confidence intervals for one-step-ahead forecasts made by this model: first compute the RMSE (root-mean-squared error, which is just and then compute a confidence interval for the seasonally adjusted forecast by adding and subtracting two times the RMSE. (Remember that a 95% confidence interval forecast "plus-or-minus-two-standard deviations," assuming the error distribution is approximately normal and the sample size is 20 or more. Here, the RMSE is the best deviation.) The confidence limits for the seasonally adjusted forecast are then reseasonalized, along with the forecast, by multiplying them by the appropriate seasonal i is equal to 27.4 and the seasonally adjusted forecast for the first future period (Dec-93) is 273.2, so the seasonally adjusted 95% confidence interval is from 273.2-2* 273.2+2*27.4 = 328.0. Multiplying these limits by December's seasonal index of 68.61%, we obtain lower and upper confidence limits of 149.8 and 225.0 around the 187.4.

Confidence limits for forecasts more than one period ahead will generally widen as the forecast horizon increases, due to uncertainty about the level and trend as well as difficult to compute them in general by analytic methods. (The appropriate way to compute confidence limits for the LES forecast is by using ARIMA theory, but the unc is another matter.) If you want a realistic confidence interval for a forecast more than one period ahead, taking all sources of error into account, your best bet is to use example, to obtain a confidence interval for a 2-step ahead forecast, you could create another column on the spreadsheet to compute a 2-step-ahead forecast for ever one-step-ahead forecast). Then compute the RMSE of the 2-step-ahead forecast errors and use this as the basis for a 2-step-ahead confidence interval.

www.duke.edu/~rnau/411outbd.htm

4/4

You might also like