1 / 33

BABS 502 Moving Averages, Decomposition and Exponential Smoothing Revised March 6, 2009

BABS 502 Moving Averages, Decomposition and Exponential Smoothing Revised March 6, 2009. 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

torin
Download Presentation

BABS 502 Moving Averages, Decomposition and Exponential Smoothing Revised March 6, 2009

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BABS 502 Moving Averages, Decomposition and Exponential SmoothingRevised March 6, 2009

  2. Moving Averages • Ft(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 MAV transformation in NCSS

  3. Moving Average Example

  4. Decomposition Method • Represent series Additively as Yt = Tt + St + Ct + It Multiplicatively as Yt = Tt St Ct It where Tt is the trend component at t St is the seasonal component at t Ct is the cyclical component at t It is the irregular or noise component at t

  5. Decomposition Methods • Some comments • Cyclical components not usually included since they cannot be forecasted and are hard to determine • A plausible approach for understanding time series behavior • Suggest the following general forecasting approach; • Deseasonalize data – use a forecasting method for stationary or trending series on the deseasonalized data and then reseasonalize. • This may be sub-optimal since the two effects can be estimated simultaneously • Multiplicative version available in NCSS • approach is ad hoc • See help file

  6. Single Exponential Smoothing • One-step ahead forecast is the weighted average of current value and past forecast • Ft(1) = a(Current Value)+ (1-a) Past Forecast= aXt+ (1-a) Ft-1(1) • Alternative representation • Ft(1) = Ft-1(1) + a [ Xt - Ft-1(1) ] • To apply this we need to choose the smoothing weight a • The closer a is to 1, the more reactive the forecast is to changes

  7. Single Exponential Smoothing Recursive function: • Ft(1) = aXt+ (1-a) Ft-1(1), • Ft-1(1) = aXt-1+ (1-a) Ft-2(1), etc Backward substitute: • Ft(1) = aXt + (1-a)aXt-1 + (1-a)2 aXt-2 + (1-a)3 aXt-3 +… When a = 0.3 this becomes • Ft(1) = .3Xt+ .7*.3 Xt-1 + (.7)2 *.3Xt-2 + (.7)3 .3Xt-3 + … = .3Xt+ .21 Xt-1 + .147 Xt-2 + .1029 Xt-3 + … This is the justification for the name “exponential” smoothing. “Age” of data is about 1/a which is the mean of the geometric distribution.

  8. Single Exponential Smoothing Example

  9. Single Exponential Smoothing Today’s level = a * Today’s value + (1-a)*Yesterday’s Level Tomorrow’s forecast = Today’s level Lt = a Xt + (1- a) Lt-1 Ft(k) = Lt for all k The level represents the systematic part of the series

  10. Simple Exponential SmoothingSpreadsheet Example

  11. BattingAverage a=.24 0.440 Batting Averages 0.410 avg 0.380 0.350 0.320 1 27 52 78 104 Time Single Exponential SmoothingNCSS Output

  12. Some Comments on Exponential Smoothing (Gardner, 1985) • Starting Values - need F0(1) to start process. Possible Choices • Data Mean • Backcasting • It is identical to an ARIMA(0,1,1) model. • In inventory applications can choose  to minimize replenishment costs. • Can let  vary with t and control it adaptively. • Parameter is chosen to minimize one step ahead forecast error.

  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 programs – exponential smoothing is applied one step ahead out of sample so that it uses more data than other methods.

  14. Double Exponential Smoothing • In a trending series, single exponential smoothing lags behind the series

  15. Double Exponential Smoothing • Double Exponential Smoothing tracks trending data better; but forecasts may not be good after a few periods

  16. Double Exponential Smoothing • The model: Separate smoothing equations for level and trend • Level Equation • Lt = a(Current Value) + (1 - a) (Level + Trend Adjustment)t-1 Lt = aXt + (1 - a) (Lt-1 + T t-1) • Trend Equation • Tt = b(Lt - Lt-1) + (1 - b) Tt-1 • Forecasting Equation • Ft(k) = Lt + k Tt

  17. Double Exponential Smoothing • Linear Trend Model Yt=0+1t is too inflexible. Requires a constant trend. • Basic idea - introduce a trend estimate that changes over time • Similar to single exponential smoothing • Issue is to choose two smoothing rates, a and b. • 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.

  18. Double Exponential Smoothing Example a = 0.637 b=0.020 L72 = 5.916 T72 = 0.013 F72(1) = 5.916 + 0.013 = 5.929 F72(1) = 5.916 + 0.013*2 = 5.942

  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 Lt = aXt + (1 - a) (Lt-1 + T t-1) • Trend Equation • Tt = b(Lt - Lt-1) + (1 - b) Tt-1 • Forecasting Equation • Available in SAS ETS and at Rob Hyndman’s website where he has R and Excel implementations of all exponential smoothing methods.

  20. Seasonality • A persistent pattern that occurs at regularly spaced time intervals • quarterly, monthly, weekly, daily • Data may exhibit several levels of seasonality • May be modeled as multiplicative or additive • Should be included in systematic part of forecasting model • Detected visually or through ACF

  21. Seasonal Data Example Monthly US Electric Power Consumption

  22. Exponential Smoothing with Trend and Seasonality • Exponential Smoothing with trend does not track or forecast seasonal data well

  23. Exponential Smoothing with Trend and Seasonality • The Holt-Winters Model tracks the seasonal pattern

  24. Holt-Winters’ Exponential Smoothing Equations Level Equation: • Lt = a(Current Value/Seasonal Adjustmentt-p) + (1-a)(Levelt-1 + Trendt-1) • Lt = a(Deseasonalized Current Value) + (1-a)(Levelt-1 + Trendt-1) • Lt = a(Xt/It-p) + (1-a)(Lt-1 + Tt-1) where It-p = Seasonal component

  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. Holt-Winters’ Exponential Smoothing Equations Trend Equation: • Same as double exponential smoothing method • Tt = b(Change in level in the last period) + (1 - b) (Trend Adjustment)t-1 • Tt = b(Lt - Lt-1) + (1 - b) Tt-1

  27. Holt-Winters’ Exponential Smoothing Equations Seasonal Equation: • It = g(Current Value/Current Level) + (1-g)(Seasonal Adjustment)t-p • It = g(Xt/Lt) + (1-g)It-p where p is the length of the seasonality (i.e. p months) Forecasting equations: • Ft(k) = (Lt + kTt)It-p+kfor k=1,2, …, p • Ft(k) = (Lt + kTt)It-2p+kfor k=p+1,p+2, …, 2p

  28. Holt-Winters’ Exponential Smoothing Equations Summary • Lt = a(Xt/It-p) + (1-a)(Lt-1 + Tt-1) Level Equation • Tt = b(Lt - Lt-1) + (1-b)Tt-1Trend Equation • It = g(Xt/Lt) + (1- g)It-pSeasonal Factor Equation Forecasting equations: • Ft(k) = (Lt + kTt)It-p+kfor k=1,2, …, p • Ft(k) = (Lt + kTt)It-2p+kfor k=p+1,p+2, …, 2p

  29. Holt-Winters’ Exponential Smoothing Example

  30. Holt-Winters’ Exponential Smoothing Example

  31. 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. • Excellent reference: Chatfield and Yar “Holt-Winters forecasting: some practical issues”, The Statistician, 1988, 129-140.

  32. 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

  33. 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.

More Related