DSCI 346 Yamasaki Lecture 7 Forecasting
Quantitative Forecasting Models based on Time-Series Time-Series data is data collected over time where each data point reporesnts a specific point in time. All time-series exhibit one or more of the following: Trend component: Long term increase or decrease Seasonal component: Shorter term repeating pattern Cyclical component: Longer term upward or downward swings, not as regular are seasonal components Random component: Unpredictable DSCI 346 Lecture 7 (19 pages)
Example Monthly Revenue of an Office Supply Company Notice : Overall upward trend DSCI 346 Lecture 7 (19 pages)
Example Notice : Seasonal trend DSCI 346 Lecture 7 (19 pages)
Forecasting using Smoothing Methods Smoothing Methods are used to “smooth” out the random component in a time series. We will discuss 3 methods. These methods work best when there is no significant trend, seasonal, or cyclical component. Simple Moving Average Weighted Moving Average Exponential Smoothing DSCI 346 Lecture 7 (19 pages)
Forecasting using Smoothing Methods Example: A company looks at the past 10 weeks of potential incoming customer sales calls Week Sales Calls 1 400 2 430 3 420 4 440 5 460 6 7 470 8 9 10 DSCI 346 Lecture 7 (19 pages)
Simple Moving Average Here we simply average the prior p values. For our example, let’s use p=3 So our forecast for week 4 would be (400+430+420)/3 = 416.7 Week Sales Calls Forecast (SMA p=3) 1 400 2 430 3 420 4 440 416.7 5 460 430.0 6 440.0 7 470 446.7 8 456.7 9 10 Forecast for 11 DSCI 346 Lecture 7 (19 pages)
Mean Absolute Deviation One way to measure overall fit is called the Mean Absolute Deviation (MAD) Where yt is actual value at time t and Ft is forecasted value at time t Week Sales Calls Forecast (SMA p=3) Absolute Error 1 400 2 430 3 420 4 440 416.7 23.33 5 460 430.0 30.00 6 440.0 0.00 7 470 446.7 8 456.7 26.67 9 6.67 10 MAD 19.52 DSCI 346 Lecture 7 (19 pages)
Comparing models using MAD Week Sales Calls Forecast (SMA p=3) Absolute Error Forecast (SMA p=4) 1 400 2 430 3 420 4 440 416.7 23.33 5 460 430.0 30.00 422.5 37.50 6 440.0 0.00 437.5 2.50 7 470 446.7 8 456.7 26.67 452.5 22.50 9 6.67 450.0 10.00 10 445.0 25.00 MAD 19.52 21.25 DSCI 346 Lecture 7 (19 pages)
Weighted Moving Average Here we weight more recent values. For our example, let’s use p=3 with weights 3 for most recent, 2 for next and 1 for furthest So our forecast for week 4 would be ((1)*400+(2)*430+(3)*420)/(1+2+3) = 420 Week Sales Calls Forecast (WMA p3) Absolute Error 1 400 2 430 3 420 4 440 420.00 20.00 5 460 431.67 28.33 6 446.67 6.67 7 470 23.33 8 458.33 9 445.00 5.00 10 441.67 21.67 MAD 19.05 DSCI 346 Lecture 7 (19 pages)
Exponential Smoothing Another way to weight more recent events is called exponential smoothing. In this methodology, the present forecast uses the prior forecast plus some portion of the prior forecast’s forecasting error: Ft = F t-1 + a(At-1 – Ft-1) Where Ft is the forecast for time t, At is the actual for time t , a is the smoothing factor F1 = A1 DSCI 346 Lecture 7 (19 pages)
Back to our sales calls example Ft = F t-1 + a(At-1 – Ft-1) Let a = 0.4 F1 = A1 = 400 F2 = F 1 + (.4)(A1 – F1) = 400 + (.4)*(400-400) = 400 F3 = F 2 + (.4)(A2 – F2) = 400 + (.4)*(430-400) = 400 + 12 = 412 F4 = F 3 + (.4)(A3 – F3) = 412 + (.4)*(420-412) = 412 + 3.2 = 415.2 DSCI 346 Lecture 7 (19 pages)
Week Sales Calls Forecast (ES a=.4) Absoute Error 1 400 400.00 2 430 2 430 30.00 3 420 412.00 8.00 4 440 415.20 24.80 5 460 425.12 34.88 6 439.07 0.93 7 470 439.44 30.56 8 451.67 21.67 9 443.00 3.00 10 441.80 21.80 Forecast for 11 433.08 MAD 19.51 DSCI 346 Lecture 7 (19 pages)
Smoothing when trend exists Exponential Smoothing with Trend Adjustment Forecast (also called double exponential smoothing) FITt = Ft + At Ft = FITt-1 + a(At-1 – FITt-1) Tt = b(Ft – Ft-1) + (1-b)Tt-1 Where FITt is the forecast including trend for time t Ft is the exponentially smoothed forecast for time t Tt is the exponentially smoothed trend for time t At-1 is the actual value for time t-1 a is the smoothing factor for the forecast b is the smoothing factor for the trend F1 =A1 T1 = 0 DSCI 346 Lecture 7 (19 pages)
Forecasting trend with Regression Analysis Week Sales Calls regression Absoute Error 1 400 424.912 24.91 2 430 427.154 2.85 3 420 429.396 9.40 4 440 431.638 8.36 5 460 433.88 26.12 6 436.122 3.88 7 470 438.364 31.64 8 440.606 10.61 9 442.848 10 445.09 25.09 Forecast for 11 447.332 MAD 14.57 DSCI 346 Lecture 7 (19 pages)
Autocorrelation Recall one of the assumptions of regression independence of residuals. When residuals are not independent, the condition is called autocorrelation DSCI 346 Lecture 7 (19 pages)
Durbin-Watson statistic Where et is the residual for time t Week Calls Regression et et2 (et – et-1)2 1 400 424.912 -24.912 620.607744 2 430 427.154 2.846 8.099716 770.506564 3 420 429.396 -9.396 88.284816 149.866564 4 440 431.638 8.362 69.923044 315.346564 5 460 433.88 26.12 682.2544 6 436.122 3.878 15.038884 494.706564 7 470 438.364 31.636 1000.836496 8 440.606 -10.606 112.487236 1784.386564 9 442.848 -2.848 8.111104 60.186564 10 445.09 -25.09 629.5081 S -0.01 3235.15154 5155.559076 DSCI 346 Lecture 7 (19 pages)
K = number of independent variables (1 in our example) Table 9 Appendix A K = number of independent variables (1 in our example) If d < dl conclude positive autocorrelation If dl < d< du test is inconclusive If d > du conclude no positive autocorrelation For our example n = 10 , a = .05 So n is too small to run test DSCI 346 Lecture 7 (19 pages)
Dealing with seasonality Methods exist, e.g., Multiplicative Time Series Model Beyond scope of class DSCI 346 Lecture 7 (19 pages)