Statistical Forecasting Models Lesson 07 Best Bet to
Statistical Forecasting Models (Lesson - 07) Best Bet to See the Future Dr. C. Ertuna 1
Statistical Forecasting Models • Time Series Models: independent variable is time. – Moving Average – Exponential Smoothening – Holt-Winters Model • Explanatory Methods: independent variable is one or more factor(s). – Regression Dr. C. Ertuna 2
Time Series Models • Statistical Time Series Models are very useful for short range forecasting problems such as weekly sales. • Time series models assume that whatever forces have influenced the variables in question (sales) in the recent past will continue into the near future. Dr. C. Ertuna 3
Time Series Components A time series can be described by models based on the following components Tt Trend Component St Seasonal Component Ct Cyclical Component It Irregular Component Using these components we can define a time series as the sum of its components or an additive model Alternatively, in other circumstances we might define a time series as the product of its components or a multiplicative model – often represented as a logarithmic model Dr. C. Ertuna 4
Components of Time Series Data • A linear trend is any long-term increase or decrease in a time series in which the rate of change is relatively constant. • A seasonal component is a pattern that is repeated throughout a time series and has a recurrence period of at most one year. • A cyclical component is a pattern within the time series that repeats itself throughout the time series and has a recurrence period of more than one year. Dr. C. Ertuna 5
Components of Time Series Data • The irregular (or random) component refers to changes in the time-series data that are unpredictable and cannot be associated with the trend, seasonal, or cyclical components. Dr. C. Ertuna 6
Stationary Time Series Models Time series with constant mean and variance are called stationary time series. When Trend, Seasonal, or Cyclical effects are not significant then a) Moving Average Models and b) Exponential Smoothing Models are useful over short time periods. Dr. C. Ertuna 7
Moving Average Models • Simple Moving Average forecast is computed as the average of the most recent k-observations. • Weighted Moving Average forecast is computed as the weighted average of the most recent k-observations where the most recent observation has the highest weight. Dr. C. Ertuna 8
Moving Average Models • Simple Moving Average Forecast • Weighted Moving Average Forecast Dr. C. Ertuna 9
Weighted Moving Average • To determine best weights and period (k) we can use forecast accuracy. • MSE = Mean Square Error is a good measure forecast accuracy. • RMSE = is the square root of the MSE. Data: Evens - Burglaries Dr. C. Ertuna 10
Weighted Moving Average • • Tools / Solver Set Target Cell: Cell containing RMSE value Equal to: Min By Changing Cells: Cells containing weights Subject to constraints: Cell containing sum of the weight = 1 Options / (check) Assume Non-Negativity Solve ----- Keep Solver Solution ----- OK Dr. C. Ertuna 11
Weighted Moving Average • Best weights for a given “k” (in this case “ 3”) is determined by solver trough minimizing RMSE. • Same procedure could be applied to models with different k’s and the one with lowest RMSE could be considered as the model with best forecasting period. Dr. C. Ertuna 12
Moving Average Models • Tools/ Data Analysis / Moving Average • Input Range: Observations with title (No time) • Output Range: Select next column to the input range and 1 -Row below of the first observation • Chart misaligns the forecasted values! Forecasted 59 th month is aligned with 58 th month Dr. C. Ertuna 13
Exponential Smoothing Exponential smoothing is a time-series smoothing and forecasting technique that produces an exponentially weighted moving average in which each smoothing calculation or forecast is dependent upon all previously observed values. • The smoothing factor “α” is a value between 0 and 1, where α closer to 1 means more weigh to the recent observations and hence more rapidly changing forecast. Dr. C. Ertuna 14
Exponential Smoothing Model or where: Ft= Forecast value for period t Yt-1 = Actual value for period t-1 Ft-1 = Forecast value for period t-1 = Alpha (smoothing constant) Dr. C. Ertuna 15
Exponential Smoothing Model • Tools/ Data Analysis / Exponential Smoothing. • Input Range: Observations with title (No time) • Output Range: Select next column to the input range and first Row of the first observation • Damping Factor: 1 -α (not α) Dr. C. Ertuna 16
Exponential Smoothing Model • To determine best “α” we can use forecast accuracy. • MSE = Mean Square Error is a good measure forecast accuracy. Dr. C. Ertuna 17
Holt-Winters Model The Holt-Winters forecasting model could be used in forecasting trends. Holt-Winters model consists of both an exponentially smoothing component (E, w) and a trend component (T, v) with two different smoothing factors. Dr. C. Ertuna 18
Holt-Winters Model where: Ft+k= Forecast value k periods from t 1. E 1 and T 1 are Yt-1 = Actual value for period t-1 not defined. Et-1 = Estimated value for period t-1 2. E 2 = Y 2 Tt = Trend for period t 3. T 2 = Y 2 – Y 1 w = Smoothing constant for estimates v = Smoothing factor for trend Dr. C. Ertuna 19 k = number of periods
Holt-Winters Model • • E_2 = Y_2 and T_2 = (Y_2 -Y_1) E_12 = $D$1*C 14+(1 -$D$1)*(D 13+E 13) T_12 = $E$1*(D 14 -D 13)+(1 -$E$1)*E 13 F_13 = D 14+E 14 Dr. C. Ertuna 20
Holt-Winters Model • Set E (smoothing component), T (trend component), and F (forecasted values) columns next to Y (actual observations) in the same sequence • Determine initial “w” and “v” values • Leave E, T &F blanc for the base period (t=1) • Set E 2 = Y 2 • Set T 2 = Y 2 -Y 1 Note: (F 2 is blanc) Dr. C. Ertuna 21
Holt-Winters Model • • Formulate E 3 = w*Y 3 + (1 -w)*(E 2+T 2) Formulate T 3 = v*(E 3 -E 2) + (1 -v)*T 2 Formulate F 3 = E 2 + T 2 Copy the formulas down until reaching one cell further than the last observation (Yn). • Compute MSE using Y’s and F’s • Use solver to determine optimal “w” and “v”. Dr. C. Ertuna 22
Holt-Winters Model Solver set up for Holt Winters: • Target Cell: MSE (min) • Changing Cells: w and v • Constrains: w <= 1 w >= 0 v <= 1 v >= 0 Dr. C. Ertuna 23
Forecasting with Crystal Ball • CBTools / CB Predictor – [Input Data] Select Range, First Raw, First Column Next – [Data Attribute] Data is in periods, etc. Next – [Method Gallery] Select All Next – [Results] Number of periods to forecast [1] Select Past Forecasts at cell Run Dr. C. Ertuna 24
Forecasting with Crystal Ball Dr. C. Ertuna 25
Forecasting with Crystal Ball Method Errors: Method Parameters: Method Best: 2 nd: Single Exponential Smoothing Single Moving Average 4 th: Double Moving Average Value Method RMSE MAD Double Exponential Smoothing 1. 5043 0. 9871 7. 68% 2 nd: Single Exponential Smoothing 1. 5147 1. 1566 9. 03% Single Moving Average 1. 5453 1. 2042 9. 40% Double Moving Average 2. 0855 1. 592 11. 16% Best Double Exponential Smoothing 3 rd: Parameter Alpha 0. 999 Beta 0. 051 Alpha : 0. 999 Periods 1 3 rd: Periods 2 4 th: MAPE Forecast: Date Lower: 5% 2000 11. 9 Forecast 14. 4 Upper: 95% 17. 0 Dr. C. Ertuna 26
Performance of a Model Performance of a model is measured by Theil’s U. Theil's U statistic falls between 0 and 1. When U = 0, that means that the predictive performance of the model is excellant and when U = 1 then it means that the forecasting performance is not better than just using the last actual observation as a forecast. Dr. C. Ertuna 27
Theil’s U versus RMSE The difference between RMSE (or MAD or MAPE) and Theil’s U is that the formars are measure of ‘fit’; measuring how well model fits to the historical data. Theil's U on the other hand measures how well the model predicts against a ‘naive’ model. A forecast in a naive model is done by repeating the most recent value of the variable as the next forecasted value. Dr. C. Ertuna 28
Choosing Forecasting Model The forecasting model should be the one with lowest Theil’s U. If the best Theil’s U model is not the same as the best RMSE model then you need to run CB again by checking only the best Theil’s U model to obtain forecasted value. P. S. CB uses forecasting value of the lowest RMSE model (best model according CB)! Dr. C. Ertuna 29
Determining Performance Theil’s U determins the forecasting performance of the model. The interpretation in daily language is as follows: Interpret (1 - Thei’l U) 1. 00 – 0. 80 High (strong) forecasting power 0. 80 – 0. 60 Moderately high forecasting power 0. 60 – 0. 40 Moderate forecasting power 0. 40 – 0. 20 Weak forecasting power 0. 20 – 0. 00 Very weak forecasting power Dr. C. Ertuna 30
Regression or Time Series Forecast Here is the guiding principle when to apply Regression and when to apply Time Series Forecast. • As some thing changes (one or more independent variables) how does another thing (dependent variable) change is an issue of directional relationship For directional relationships we can use regression. • If the independent variable is TIME (as time changes how does a variable change) Then we can use either regression or time series forecasting models Dr. C. Ertuna 31
Explanatory Methods Simple Linear Regression Model: The simplest inferential forecasting model is the simple linear regression model, where time (t) is the independent variable and the least square line is used to forecast the future values of Yt. Dr. C. Ertuna 32
Regression in Forecasting Trends where: Yt = Value of trend at time t 0 = Intercept of the trend line 1 = Slope of the trend line t = Time (t = 1, 2, . . . ) Dr. C. Ertuna 33
Regression in Forecasting Seasonality • Many time series have distinct seasonal pattern. (For example room sales are usually highest around summer periods. ) • Multiple regression models can be used to forecast a time series with seasonal components. • The use of dummy variables for seasonality is common. – Dummy variables needed = total number of seasonality – 1 – For example: Quarterly Seasonal: 3 Dummies are needed, Monthly Seasonal: 11 Dummies needed, etc. – The load of each seasonal variable (dummy) is compared to the one which is hidden in intercept. Dr. C. Ertuna 34
Regression in Forecasting Seasonality where: Q 1 = 1 , if quarter is 1, = 0 otherwise Q 2 = 1 , if quarter is 2, = 0 otherwise Q 3 = 1 , if quarter is 3, = 0 otherwise 2 = the load of Q 1 above Q 4 0 = the overall intercept + the load of Q 4 t = Time (t = 1, 2, . . . ) Dr. C. Ertuna 35
Seasonal Regression E(Y_Q 1) = -10801. 6 + 5. 52 * Year. 1 + 8. 06 E(Y_Q 2) = -10801. 6 + 5. 52 * Year. 2 + -3. 50 E(Y_Q 3) = -10801. 6 + 5. 52 * Year. 3 + 5. 51 E(Y_Q 4) = -10801. 6 + 5. 52 * Year. 4 Dr. C. Ertuna 36
Next Lesson (Lesson - 09) Introduction to Optimization Dr. C. Ertuna 37
- Slides: 37