Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 BABS 502 Moving Averages, Decomposition and Exponential Smoothing Revised March 14, 2010.

Similar presentations


Presentation on theme: "1 BABS 502 Moving Averages, Decomposition and Exponential Smoothing Revised March 14, 2010."— Presentation transcript:

1 1 BABS 502 Moving Averages, Decomposition and Exponential Smoothing Revised March 14, 2010

2 © Martin L. Puterman – Sauder School of Business 2 Moving Averages  F t (1) is average of last m observations  Issue is to choose m  Most appropriate if series is random variation around a mean  This is the case if all autocorrelations are near zero  Not intended as a forecasting method - best for smoothing a series and determining patterns  Lags behind an increasing series  Calculated in a spreadsheet using Average function or using the MAVk transformation in NCSS.  Note NCSS averages past k observations.  Alternatives are median smooth or LOESS smooth which are available in NCSS graphical routines.

3 © Martin L. Puterman – Sauder School of Business 3 Moving Average Example

4 © Martin L. Puterman – Sauder School of Business 4 Decomposition Method  Represent series Additively as Y t = T t + S t + C t + I t Multiplicatively as Y t = T t S t C t I t where T t is the trend component at t S t is the seasonal component at t C t is the cyclical component at t I t is the irregular or noise component at t

5 © Martin L. Puterman – Sauder School of Business 5 Decomposition Methods  Some comments  Cyclical components not usually included since they cannot be forecasted and are hard to determine (may not exist)  A plausible approach for understanding time series behavior  Its suggests the following general forecasting approach; - Deseasonalize data – use a forecasting method for stationary or trending series on the deseasonalized data and then reseasonalize.

6 © Martin L. Puterman – Sauder School of Business 6 Single Exponential Smoothing  One-step ahead forecast is the weighted average of current value and past forecast  F t (1) =  Current Value)+ (1-  ) Past Forecast =  X t + (1-  ) F t-1 (1)  Alternative representation  F t (1) = F t-1 (1) +  X t - F t-1 (1) ] This is previous forecast plus a constant times previous forecast error  To apply this we need to choose the smoothing weight   The closer  is to 1, the more reactive the forecast is to changes

7 © Martin L. Puterman – Sauder School of Business 7 Single Exponential Smoothing Recursive function:  F t (1) =  X t + (1-  ) F t-1 (1),  F t-1 (1) =  X t-1 + (1-  ) F t-2 (1), etc Backward substitute:  F t (1) =  X t + (1-  )  X t-1 + (1-  ) 2  X t-2 + (1-  ) 3  X t-3 +… When  0.3 this becomes  F t (1) =.3X t +.7*.3 X t-1 + (.7) 2 *  X t-2 + (.7) 3  X t-3 + … =.3X t +.21 X t-1 +.147 X t-2 +.1029 X t-3 + … This is the justification for the name “exponential” smoothing. “Age” of data is about 1/  which is the mean of the geometric distribution.

8 © Martin L. Puterman – Sauder School of Business 8 Single Exponential Smoothing Example

9 © Martin L. Puterman – Sauder School of Business 9 Single Exponential Smoothing Today’s level =  Today’s value + (1-  )  Yesterday’s Level Tomorrow’s forecast = Today’s level L t =  X t + (1-  ) L t-1 F t (k) = L t for all k The level represents the systematic part of the series

10 © Martin L. Puterman – Sauder School of Business 10 Simple Exponential Smoothing Spreadsheet Example Easy to use excel optimizer to choose alpha to minimize mean absolute percentage out of sample forecast error.

11 © Martin L. Puterman – Sauder School of Business 11 Single Exponential Smoothing NCSS Output VariablePulp_Price Number of Rows84 Mean579.2857 Pseudo R-Squared0.798127 Mean Square Error4232.143 Mean |Error|44.28571 Mean |Percent Error|7.838659 Alpha SearchMean |Percent Error| Alpha1 Forecast540

12 © Martin L. Puterman – Sauder School of Business 12 Some Comments on Exponential Smoothing (Gardner, 1985)  Starting Values - need F 0 (1) to start process. Possible Choices  Data Mean  Backcasting  Simple exponential smoothing is identical to ARIMA(0,1,1) model.  Parameter is chosen to minimize either the root mean square, mean absolute or mean absolute percentage one step ahead forecast error.

13 © Martin L. Puterman – Sauder School of Business 13 Some Comments on Out of Sample Testing  When comparing methods out of sample be sure to check how the out of sample forecast is computed and what information is assumed known.  In some automatic programs – exponential smoothing is applied one step ahead out of sample so that it uses more data than other methods.

14 © Martin L. Puterman – Sauder School of Business 14 Double Exponential Smoothing In a trending series, single exponential smoothing lags behind the series

15 © Martin L. Puterman – Sauder School of Business 15 Double Exponential Smoothing Double Exponential Smoothing tracks trending data better; but forecasts may not be good after a few periods

16 © Martin L. Puterman – Sauder School of Business 16 Double Exponential Smoothing  Linear Trend Model Y t =  0 +  1 t is inflexible. Assumes a constant trend  1 per period.  Basic idea - introduce a trend estimate that changes over time.  Similar to single exponential smoothing  Issue is to choose two smoothing rates,  and   Referred to as Holt’s Linear Trend Model in NCSS  Trend dominates after a few periods in forecasts so forecasts are only good for a short term.

17 © Martin L. Puterman – Sauder School of Business 17 Double Exponential Smoothing  The model: Separate smoothing equations for level and trend  Level Equation  L t =  (Current Value) + (1 -  ) (Level + Trend Adjustment) t-1 L t =  X t + (1 -  ) (L t-1 + T t-1 )  Trend Equation  T t =  (L t - L t-1 ) + (1 -  ) T t-1  Forecasting Equation F t (k) = L t + k T t

18 © Martin L. Puterman – Sauder School of Business 18 Double Exponential Smoothing Example  = 0.637  =0.020L 72 = 5.916 T 72 = 0.013 F 72 (1) = 5.916 + 0.013 = 5.929 F 72 (1) = 5.916 + 0.013*2 = 5.942

19 © Martin L. Puterman – Sauder School of Business 19 Damped Trend Models  Problem with a trend model is that trend dominates forecast in a couple of periods.  Approach - introduce trend damping parameter   Level Equation L t =  X t + (1 -  ) (L t-1 +  T t-1 )  Trend Equation  T t =  (L t - L t-1 ) + (1 -  )  T t-1  Forecasting Equation  Available in SAS ETS, R and Hyndman’s forecast package for Excel Phicast

20 © Martin L. Puterman – Sauder School of Business 20 Seasonality  A persistent pattern that occurs at regularly spaced time intervals  quarterly, monthly, weekly, daily  Data may exhibit several levels of seasonality simultaneously  May be modeled as multiplicative or additive  Should be included in systematic part of forecasting model  Detected visually or through ACF

21 © Martin L. Puterman – Sauder School of Business 21 Seasonal Data Example Monthly US Electric Power Consumption

22 © Martin L. Puterman – Sauder School of Business 22 Exponential Smoothing with Trend and Seasonality Exponential Smoothing with trend does not track or forecast seasonal data well

23 © Martin L. Puterman – Sauder School of Business 23 The Holt-Winters Model tracks the seasonal pattern Exponential Smoothing with Trend and Seasonality

24 © Martin L. Puterman – Sauder School of Business 24 Holt-Winters’ Exponential Smoothing Equations Level Equation:  L t =  (Current Value/Seasonal Adjustment t-p ) + (1-  )(Level t-1 + Trend t-1 )  L t =  (Deseasonalized Current Value) + (1-  )(Level t-1 + Trend t-1 )  L t =  (X t /I t-p ) + (1-  )(L t-1 + T t-1 ) where I t-p = Seasonal component

25 © Martin L. Puterman – Sauder School of Business 25 Holt-Winters’ Exponential Smoothing  Generalizes Double Exponential Smoothing by including (multiplicative) seasonal indicators.  Separate smoothing equations for level, trend and seasonal indicators.  Allows trend and seasonal pattern to change over time  Must estimate three smoothing parameters  Equations more complicated but implemented with software  One of the best methods for short term seasonal forecasts

26 © Martin L. Puterman – Sauder School of Business 26 Holt-Winters’ Exponential Smoothing Equations Trend Equation:  Same as double exponential smoothing method  T t =  (Change in level in the last period) + (1 -  ) (Trend Adjustment) t-1  T t =  (L t - L t-1 ) + (1 -  ) T t-1

27 © Martin L. Puterman – Sauder School of Business 27 Holt-Winters’ Exponential Smoothing Equations Seasonal Equation:  I t =  (Current Value/Current Level) + (1-  )(Seasonal Adjustment) t-p  I t =  (X t /L t ) + (1-  )I t-p where p is the length of the seasonality (i.e. p months) Forecasting equations:  F t (k) = (L t + kT t )I t-p+k for k=1,2, …, p  F t (k) = (L t + kT t )I t-2p+k for k=p+1,p+2, …, 2p

28 © Martin L. Puterman – Sauder School of Business 28 Holt-Winters’ Exponential Smoothing Equations Summary  L t =  (X t /I t-p ) + (1-  )(L t-1 + T t-1 ) Level Equation  T t =  (L t - L t-1 ) + (1-  )T t-1 Trend Equation  I t =  (X t /L t ) + (1-  )I t-p Seasonal Factor Equation Forecasting equations:  F t (k) = (L t + kT t )I t-p+k for k=1,2, …, p  F t (k) = (L t + kT t )I t-2p+k for k=p+1,p+2, …, 2p

29 © Martin L. Puterman – Sauder School of Business 29 Holt-Winters’ Exponential Smoothing Example Forecast Summary Section VariablePulp_Price Number of Rows84 Mean579.2857 Pseudo R-Squared0.766036 Mean Square Error4904.916 Mean |Error|44.74108 Mean |Percent Error|7.992905 Forecast MethodWinter's with multiplicative seasonal adjustment. Search Iterations120 Search CriterionMean |Percent Error| Alpha0.999787 Beta0.1984507 Gamma0.4674903 Intercept (A)-113.6628 Slope (B)7.878917 Season 1 Factor1.008922 Season 2 Factor0.9970459 Season 3 Factor0.9850978 Season 4 Factor1.008935 Initial values for forecasts

30 © Martin L. Puterman – Sauder School of Business 30 Holt-Winters Further Comments  Can add damped trend to this model too.  Additive version also available but multiplicative model is preferable. Note the HW model combines additive trend with multiplicative seasonality.  Missing values cannot be skipped, they must be estimated.  Outliers have a big impact and could be handled like missing values  This is a special case of a “state space model”.  Different computer packages give different estimates and forecasts.  Early reference: Chatfield and Yar “Holt-Winters forecasting: some practical issues”, The Statistician, 1988, 129-140.

31 © Martin L. Puterman – Sauder School of Business 31 Applying Exponential Smoothing Models  Plot data  determine patterns - seasonality, trend, outliers  Fit model  Check residuals  Any information present? - Plots or ACF functions  Adjust  Produce forecasts  Calibrate on hold out sample  Multiple one step ahead  k-step ahead (where is k is the practical forecast horizon)

32 © Martin L. Puterman – Sauder School of Business 32 Using Exponential Smoothing in Practice  Important issue is how frequently to recalibrate the model  Possible choices - Every period - Quarterly - Annually  The point here is that the model can be determined by analysts, programmed into a forecasting system with fixed parameters and recalibrated as needed.

33 © Martin L. Puterman – Sauder School of Business Some interesting recent work on exponential smoothing by R. Hyndman  Article Article  Phicast Phicast


Download ppt "1 BABS 502 Moving Averages, Decomposition and Exponential Smoothing Revised March 14, 2010."

Similar presentations


Ads by Google