Exponential Smoothing: Seasonality
Total Page:16
File Type:pdf, Size:1020Kb
CTL.SC1x -Supply Chain & Logistics Fundamentals Exponential Smoothing: Seasonality MIT Center for Transportation & Logistics CTL.SC1x - Supply Chain and Logistics Fundamentals Fundamentals Logistics and Chain - Supply CTL.SC1x Annual Seasonality for Various Products forVarious Seasonality Annual cloth bandages bandages cloth candy chocolate& garden tools garden salads salads Jan Lesson: Exponential Smoothing with Seasonality withSmoothing Seasonality Exponential Lesson: Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Agenda • Double Exponential Smoothing Model n Level & Seasonality • Holt-Winter Model n Level, Trend & Seasonality • Initialization of Parameters • Practical Concerns CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 3 Double Exponential Smoothing CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 4 Time Series Analysis a • Exponential Smoothing for Level & Seasonality Demand rate time n Double exponential smoothing SF n Introduces multiplicative seasonal term Demand rate Underlying Model: xt = aFt + et time 2 where: et ~ iid (µ=0 , σ =V[e]) Forecasting Model: ˆ ˆ ˆ The most current estimate xt,t+τ = at Ft+τ −P of the appropriate seasonal index Updating Procedure: " x % aˆ = α$ t '+ 1−α aˆ t $ ˆ ' ( )( t−1) F De-seasonalizing F = Multiplicative seasonal index # t−P & t the most recent appropriate for period t ! x $ actual observation. P = Number of time periods within the Fˆ = γ # t &+ 1−γ Fˆ seasonality t # aˆ & ( ) t−P γ = Seasonality smoothing factor " t % Note that: P This term “de-levels” the most Fˆ = P recent actual observation. ∑i=1 i CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality Seasonality • For multiplicative seasonality, think of the Fi as “percent of average demand” for a period i • The sum of the Fi for all periods within a season must equal P 1.5 Fi ) i Monday 0.50 1.0 Tuesday 0.75 Wednesday 1.25 Thursday 1.00 0.5 Seasonality Factor (F Factor Seasonality Friday 1.50 Time period (t) 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 No seasonality M T W R F M T W R F M T W R F Seasonality τ! ˆ ˆ ˆ xt,t+τ = at Ft+τ −P P Suppose we are in Monday (t=105) forecasting for Thursday (t=108)? What is Ft+tau-P? • This means t=105, P=5 and τ=3 and thus t+τ-P=105+3-5 = 103 ^ ^ ^ • So, x 105,108 = a 105F 103 • We modify the most recent estimate of level by the most recent relevant seasonality index CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 6 Example: Forecasting Bagels • We observe that demand is level with seasonality by day of week. It is now Friday (t=104) and we have estimated the ^ level (a 104) to be 121 bagels. The current daily seasonality factors are shown to the right and smoothing factors alpha=0.1 and gamma=0.05. t DOW Fi ^ 100 Mon • What is your forecast for Monday (x 104,105)? 0.50 Recall that: ˆ ˆ ˆ so x^ = (121)(0.50) = 60.5 101 Tues 0.75 xt,t+τ = at Ft+τ −P 104,105 102 Wed 1.25 Suppose our actual bagel sales on Monday (t=105) was 76. • 103 Thur 1.00 What is our forecasted demand for Tuesday (t=106)? 104 Fri 1.50 Current Seasonality Factors " x % aˆ = α$ t '+ 1−α aˆ t $ ˆ ' ( )( t−1) # Ft−P & ! x $ Fˆ = γ # t &+ 1−γ Fˆ t # ˆ & ( ) t−P " at % xˆ aˆ Fˆ =D10*E6 t,t+τ = t t+τ −P =$C$1*(C10/E5)+(1-$C$1)*D9 =$C$2*(C10/D10)+(1-$C$2)*E5 CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 7 Normalizing Seasonality Indices CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 8 Example: Forecasting Bagels • The seasonality factors no longer sum to P!! • So what? What happens if I ignore this? • Need to update or normalize them. t DOW ^ Fi • What is the new seasonality factor F 106 ? 100 Mon 0.500 # & 101 Tues 0.750 102 Wed 1.250 NEW OLD P ˆ ˆ % ( 103 Thur 1.000 Ft = Ft % t ( 104 Fri % Fˆ OLD ( 1.500 $∑i=t−P t ' 105 Mon 0.506 106 Tues Estimates Normalized Tues 0.750 0.749 Seasonality factors must be kept Wed 1.250 1.249 current or they will drift dramatically. Thur 1.000 0.999 This requires a lot more bookkeeping Fri 1.500 1.498 which is tricky to maintain in a Mon 0.506 0.505 Sum 5.006 5.000 spreadsheet. CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 9 Holt-Winter Model CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 10 Time Series: Level, Trend, & Seasonal Data • Expanding exponential Holt’s model to include trend • Commonly called the Holt-Winter Method aa • Multiplicative seasonality and additive trend Demand rate Underlying Model: time xt = (a+tb) Ft + et 2 b where: et ~ iid (µ=0 , σ =V[e]) De-seasonalizing Demand rate the most recent time Forecasting Model: xˆ = aˆ +τbˆ Fˆ t,t+τ ( t t ) t+τ −P observation FS Where : ! x $ Old estimate t ˆ of level and aˆ = α# &+ 1−α aˆ + b Demand rate t # Fˆ & ( )( t−1 t−1) trend " t−P % time No change from Holt ˆ ˆ bt = β aˆt − aˆt 1 + 1− β bt 1 Model! ( − ) ( ) − No change from level ! x $ & seasonality model! Fˆ = γ # t &+ 1−γ Fˆ t # ˆ & ( ) t−P " at % Current observation Seasonal term from most is “de-leveled” recent similar time period. CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality Example II: Forecasting Bagels • We now observe that demand is level with additive trend and multiplicative seasonality by day of week. It is now Friday (t=104) ^ and we have estimated the level (a 104) to be 121 bagels with a ^ trend (b 104)=0.3 bagles per day. The current daily seasonality factors are shown to the right and smoothing factors are t DOW F alpha=0.1, beta=0.08, and gamma=0.05. i ^ 100 Mon 0.50 • What is your forecast for Monday (x 104,105)? 101 Tues ˆ ˆ ^ 0.75 Recall that: xˆt,t = aˆ t +τbt Ft P so x 104,105 = (121+0.3)(0.50) = 60.7 +τ ( ) +τ − 102 Wed • Suppose our actual bagel sales on Monday (t=105) was 76. What 1.25 is our forecasted demand for Tuesday (t=106)? 103 Thur 1.00 104 Fri 1.50 ! x $ aˆ = α# t &+ 1−α aˆ + bˆ t # ˆ & ( )( t−1 t−1) " Ft−P % bˆ = β aˆ − aˆ + 1− β bˆ t ( t t−1) ( ) t−1 ! x $ Fˆ = γ # t &+ 1−γ Fˆ t # ˆ & ( ) t−P " at % ˆ ˆ xˆt,t = aˆt +τbt Ft P =$C$1*(C11/F6)+(1-$C$1)*(D10+E10) =(D11+E11)*F7 +τ ( ) +τ − =$C$2*(D11-D10)+(1-$C$2)*E10 =$C$3*(C11/D11)+(1-$C$3)*F6 CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 12 Initialization of Models CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 13 Initialization of Parameters • Points to Note n No single best method – many good ones n Need to partition the data (initialization, training, and testing) • Simple Exponential Smoothing Model ^ n Estimate initial level parameter (a 0) n Use average demand for first several periods • Holt Model ^ ^ n Estimate initial level (a 0) and trend (b 0) parameters (a & b) n Find best fit linear equation to data in initial data set n Use ordinary least squares regression of demand for several periods w Dependent variable = demand in each time period = xt w Independent variable = slope = β1 w Regression equation: xt = β0 + β1t n Note: this gives equal weight to each observation in the initialization data sample CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 14 Initialization of Parameters • Seasonality Models n These are much more complicated n Several different methods used in practice n You need lots of data – >2 seasons worth but prefer ≥4 seasons • Double Exponential Smoothing Model ^ ^ n Estimate initial level parameter (a 0) & seasonality indices (F i) n Find average demand for each common season period n Find average demand for all periods n Set initial seasonality indices to ratio of each season to all periods Average Initial 200 Daily Seasonality 180 160 Day Demand Index 140 Mon 60 0.50 120 Tues 90 0.75 100 80 Wed 151 1.25 60 Daily Bagel Demand Daily Thur 121 1.00 40 80 85 90 95 100 Fri 181 1.50 Time Period (t=80 is Monday) All Days 121 CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 15 Initialization – Holt-Winter 1. Estimate initial level for each season MA5 n Find P-Moving Avg centered in each season Actual Center Initial Fi Week t DOW Demand point Estimate n Take ratio of actual to initial Fi estimate 1 80 M 62 2. Find initial season indices 81 T 91 n Average F for common periods 82 W 163 128.3 1.273 i 83 R 129 129.4 1.000 300 84 F 196 132.0 1.483 Actual Demand MA5 Centerpoint 2 85 M 68 137.9 0.492 250 86 T 104 141.3 0.735 200 87 W 193 147.3 1.307 88 R 147 149.8 0.979 150 89 F 226 152.5 1.481 100 3 90 M 80 154.3 0.518 Daily Bagel Demand Bagel Demand Daily 91 T 118 160.0 0.736 50 92 W 201 169.7 1.186 80 85 90 95 100 Time Period (t=80 is Monday) 93 R 175 172.2 1.018 94 F 274 176.9 1.551 DOW Average of F Estimates Normalized F s i i 4 95 M 92 185.9 0.495 M 0.501 0.506 96 T 142 188.4 0.752 T 0.741 0.748 97 W 246 191.5 1.286 W 1.195 1.195 98 R 187 R 0.998 0.998 99 F 290 F 1.516 1.516 Sum 4.952 5.000 CTL.SC1x - Supply Chain and Logistics Fundamentals Lesson: Exponential Smoothing with Seasonality 16 Initialization – Holt-Winter 3.