View
232
Download
0
Category
Preview:
Citation preview
Data = Truth + Error
A Paradigm for Any Data
Finding Truth in Forecasting
1. Smoothing: Truth can be “approximated” by averaging
out data.
2. Standard Models: Truth can be “approximated” by a standard
forecasting model (DGP)
FM 1: Smoothing
• How to average out data?
• How to forecast?
• Problems?
• When most applicable?
Notations (NB)
1. Level, Lt
2. Trend, Tt
3. Season, Ft
4. Irregulart
(Equal variability)
Not constant
When Most Applicable
• Many items to forecast– E.g. demand for standard items
• Automatic procedure is needed
• Excel works well for implementation– (if Eviews is not available)
• Model for Yt:
Yt = Lt + irregulart
No trend, no seasonality
• Forecasting of Y(T+h)
Pred_Y(T+h|T) = YT(h) in NB = LT
A. Simple Exponential Smoothing
Estimation of LT
• Information set at T
• Average only the most recent m observations
1 2 ( 4) ( 3) ( 2) ( 1), ,..., , , , ,T T T T T TY Y Y Y Y Y Y
( 1) ( 1)
1_ ...T T T T mest L Y Y Y
m
• weighted average of all observations:
LT = wT YT + w(T-1) Y(T-1) + …
0 < wt < 1 for all t
• greater weights for recent data points.
Estimation of LT – cont.
Weighting Scheme
• Choose 0 < < 1
• wT =
• w(T-1) = (1-)
• w(T-2) = (1-)2 and so on.
• Note:
2 31 1 1 1
1 1
Recursive Form Algorithm
LT = YT + Y(T-1) + 2 Y(T-2) + ...
= YT +L(T-1)
L(T-1) = Y(T-1) +L(T-2) and so on.
Est. for t = (smooth. const.) x Data @ t + (1 - s. c.)(Est. @ t-1)
Example 1
Year Time, t Yt Lt Computation ( = 0.7)
1991 1 1426 1426.00 L1 = Y1
1992 2 1471 1457.50 0.7 (1471) + (1 - 0.7) 1426
1993 3 1475 1469.75 0.7(1475) + (1 - 0.7) 1457.5
1994 4 1566
1995 5 1669
1 7 6
Initialize
Error Correction Form
• One Step Ahead Forecast Error– et = Yt - L(t-1)
• Error Correction Form
– LT =YT + (1 - ) L(T-1) =(YT - L(T-1)) + L(T-1)
= L(T-1) + eT
Est. for t = Est.@ t-1 + s.c.(forecast error@t)
Example 2
a 0.7
Year Time, t Yt Lt et Error Correction
1991 1 1426 1426.00
1992 2 1471 1457.50 45.00 1457.50 (=1426+0.7*45)
1993 3 1475 1469.75 17.50 1469.75 (=1457.5+0.7*17.5)
1994 4 1566 1537.13 96.25 1537.13
1995 5 1669 1629.44 131.88 1629.44
Initialize, no error
Recursive Form
Selecting
• Extreme Values = 1 LT = YT
= 0 LT = L1 (initial value)
• Guide Lines
Large for less volatile series
Small for more volatile series
SSE and RMSE
• SSE = Sum of Squared Residuals– For Exponential Smoothing, SSE = Sum of
Squared One Step Ahead Forecasting Errors.
• RMSE = Root Mean Squared Error – Square Root of { SSE / # of Errors in SSE }
Practicality
1. Only information needed to forecast
Y(T+1) is { YT and L(T-1) }
Forecast of Y(T+1|T) = LT= YT + (1 - ) L(T-1)
2. Robustness
Ref. NB 6.10
Two Problems
• How to determine the initial value?– Use the first observation– Take the average of the first half observations
• How to determine the best smoothing constant, ?– Use RMSE as a guide– Do not minimize RMSE
Extensions of Simple Exponential Smoothing
• Data = Trend + Seasonality + Cycle + Irregularity
• How to Incorporate Trend and Seasonality for Forecast?– B: Holt’s Linear Trend for Trend without Seasonality– C: Holt-Winters for Trend and Seasonality
• Problems– (1) Initial estimates– (2) smoothing constants – one for each component
B. Holt’s Linear Trend Exponential Smoothing
Holt
Simple
Yt
tT
Include Trend Component for Forecast
Model for Data: Yt = Lt + irregulart
Lt = L(t-1) +T(t-1)
Forecast: Pred_Y(T+1 | T) = LT + TT
Pred_Y(T+h | T) = LT +hTT
h=1, 2, …
Recursive Formula for Lt and Tt
For Level: Lt = Yt + (1 - )(L(t-1) + T(t-1))
For Trend: Tt = (Lt - L(t-1)) + (1 -) T(t-1)
Est. for t = (smooth. const.) x Data@t + (1 - s.c.)(Est.@t-1)
Example 1
Yt
Lt
Tt
Computation ( = 0.5, = 0.3)
1 1813 1813
2 1650 1650 -163 L2 = 1650
T2 = 1650 - 1813
3 1822 1654.5 -112.78 L3 = 0.5(1822) + 0.5(1650 +(-163))
T3 = 0.3 (1654.5 - 1650) + 0.7 (-163)
4 1778 1659.88 -77.31 L4 = 0.5 (1778) + 0.5 (1654.5 +(-112.78)
T4 = 0.3 (1659.88 - 1654.5) + 0.7 (-112.78)
5 1520 1551.28 - 86.70
176
Initialize
Error Correction Form
“One Step Ahead” Forecast Error for Yt :
et = Yt - {L(t-1) + T(t-1)}
ECF (see page 198 of NB):
Lt = {L(t-1) + T(t-1)} + e t
Tt = T(t-1) + e t
Est. for t = Est.@t-1 + (s.c.)(forecast error@t)
Example 2
Yt
Lt
Tt
Computation ( = 0.5, = 0.3)
1 1813 1813
2 1650 1650 -163 L2 = 1650
T2 = 1650 - 1813
3 1822 1654.5 -112.75 e2 = 1822 - {1650 + (-163)} = 335
L3 = {1650 + (-163)} + 0.5 (335)
T3 = (-163) + (0.5)(0.3)(335)
4 1778 1659.88 -77.31 e3 = 1778 - {1654.5 + (-112.75)} = 236.25
L4 = {1654.5 + (-112.75)} + 0.5 (236.25) = 1659.88
T4 = (-112.75) + (0.5)(0.3)(236.25) = -77.31
5 1520 1551.28 - 86.70 e4 = 1520 - { 1659.88 + (-77.31) } = - 62.57
L5 = {1659.88 + (-77.31)} + 0.5 (-62.57)
T5 = (-77.31) + (0.5)(0.3) (-62.57) = -86.70
176
Initialize
Forecasting Sales Using Holt's Linear Exponential SmoothingSSE= 2.57E+12
0.7000 0.5000
Data Standard Algorithm One Step Ahead Forecast Error Correction Formt Yt Lt Tt L(t-1) + T(t-1) et Lt Tt
1 4477522 349598 349598 -981543 414581 365640 -41056 251444 163137 365640 -410564 477851 431871 12587 324584 153267 431871 125875 538203 510080 45398 444458 93745 510080 453986 507278 521738 28528 555478 -48200 521738 285287 521351 530026 18408 550266 -28915 530026 184088 532782 537477 12930 548433 -15651 537477 129309 566398 561601 18527 550407 15991 561601 18527
10 603704 596631 26778 580127 23577 596631 2677811 545344 568764 -544 623409 -78065 568764 -54412 521980 535852 -16728 568219 -46239 535852 -1672813 625043 593267 20344 519124 105919 593267 2034414 620319 618307 22691 613611 6708 618307 2269115 666157 658609 31497 640998 25159 658609 3149716 613159 636243 4566 690106 -76947 636243 456617 635441 637051 2687 640809 -5368 637051 268718 674235 663886 14761 639738 34497 663886 1476119 818490 776537 63706 678647 139843 776537 6370620 737921 768618 27893 840243 -102322 768618 27893
Computing Holt’s Linear Trend Smoothing – an Illustration
Comparison With Fixed Trend
• Fixed Trend:
Y( T+1| T) = + T+1) = LT +
• Holt’s Model:
Y( T+1| T) = LT + T (slope variable)
Let: s : # of “seasons” in a year
Model for Yt = Lt +Ft + irregulart
- additive seasonality
Yt = Lt Ft (irregulart)- multiplicative seasonality
Lt = Lt-1 + Tt-1
C. Holt-Winters Seasonal Exponential Smoothing
Additive Seasonality
Pred_YT+1|T = LT+TT+F(T+1-s)
Pred_YT+h|T = LT+hTT+F(T+h-s)
Multiplicative Seasonality
Pred_ YT+1|T = (LT+TT) F(T+1-s)
Pred_ YT+h|T = (LT+h TT) F(T+h-s)
Forecasting for Holt – Winters MethodsNeed to Estimate Ft by F(t-s)
Recursive Formula- additive seasonality
• Level: Lt = (Yt - F(t-s) ) + (1 - ) {L(t-1) + T(t-1)}
• Trend: Tt = (Lt - L(t-1)) + (1 - ) T(t-1)
• Season: Ft = (Yt - Lt) + (1 - ) F(t-s)
Est. for t = (smooth. const.) x Data@t + (1 - s.c.)(Est.@t-1)
• Error: et = Yt - (Lt-1 + Tt-1 + F(t - s))
• ECF:
Lt = (L(t-1) +T(t-1)) e t
Tt = T(t-1) + et
Ft = F(t-s) + e t
Error Correction Form- additive seasonality
Est. for t = Est.@t-1/s + (s.c.)(forecast error@t)
Recursive Formula- multiplicative seasonality
• Level:
• Trend:
• Season:
Lt = Yt
Ft-s + 1- L(t-1)+ T(t-1)
Tt = (Lt - L(t-1)) + (1 - ) T(t-1)
Ft = Yt
Lt + 1- F(t-s)
• Error: et = Yt - (L(t-1) + T(t-1) ) F(t-s)
• ECM:
Lt = L(t-1) +T(t-1) e t / F(t-s)
Tt = T(t-1) + e t / F(t-s)
Ft = F(t-s) + e t / Lt
Error Correction Form- multiplicative seasonality
Determining Initial Values
• Use the average of the first s observations of data for L1 ..Ls.
• Compute the F1 through Fs, using (Y1, L1) …(Ys, Ls).
• Set T1…Ts = 0
Note: This is just one method.
Example: Additive Seasonality
Holt- Winter's Seasonal Exponential Smoothing NB page 201
0.3 One Step Ahead Forecast & Error Correction Form Estimation 0.4 Error 0.5
t Season Yt Lt Tt Ft Y(t|t-1) et Lt Tt Ft
1 1 897 564.50 0.00 332.50 564.50 0.00 332.502 2 476 564.50 0.00 -88.50 564.50 0.00 -88.503 3 376 564.50 0.00 -188.50 564.50 0.00 -188.504 4 509 564.50 0.00 -55.50 564.50 0.00 -55.505 1 967 585.50 8.40 357.00 897.00 70.00 585.50 8.40 357.006 2 529 600.98 11.23 -80.24 505.40 23.60 600.98 11.23 -80.247 3 407 607.20 9.23 -194.35 423.71 -16.71 607.20 9.23 -194.358 4 371 559.45 -13.56 -121.97 560.92 -189.92 559.45 -13.56 -121.979 1 884 540.22 -15.83 350.39 902.88 -18.88 540.22 -15.83 350.39
10 2 407 513.24 -20.29 -93.24 444.15 -37.15 513.24 -20.29 -93.2411 3 310 496.37 -18.92 -190.36 298.61 11.39 496.37 -18.92 -190.3612 4 338 472.21 -21.02 -128.09 355.48 -17.48 472.21 -21.02 -128.0913 1 900 480.72 -9.21 384.84 801.58 98.42 480.72 -9.21 384.8414 2 448 492.43 -0.84 -68.83 378.27 69.73 492.43 -0.84 -68.8315 3 344 504.42 4.29 -175.39 301.23 42.77 504.42 4.29 -175.3916 4 274 476.73 -8.50 -165.41 380.62 -106.62 476.73 -8.50 -165.4117 1 740 434.31 -22.07 345.27 853.06 -113.06 434.31 -22.07 345.2718 2 261 387.52 -31.96 -97.68 343.40 -82.40 387.52 -31.96 -97.6819 3 289 388.21 -18.90 -137.30 180.17 108.83 388.21 -18.90 -137.3020 4 319 403.84 -5.09 -125.12 203.90 115.10 403.84 -5.09 -125.1221 1 1036 486.35 29.95 447.46 744.02 291.98 486.35 29.95 447.4622 2 602 571.31 51.96 -33.49 418.62 183.38 571.31 51.96 -33.4923 3 536 638.28 57.96 -119.79 485.97 50.03 638.28 57.96 -119.7924 4 349 629.60 31.31 -202.86 571.11 -222.11 629.60 31.31 -202.8625 1 1050 643.40 24.30 427.03 1108.37 -58.37 643.40 24.30 427.0326 2 633 667.34 24.16 -33.92 634.21 -1.21 667.34 24.16 -33.9227 3 435 650.48 7.75 -167.64 571.71 -136.71 650.48 7.75 -167.6428 4 415 646.13 2.91 -216.99 455.37 -40.37 646.13 2.91 -216.99
Starting Values 1076.061. T1=T2=T3=T4 = 02. L1=L2=L3=L4 = 564.5 = Average (Y1, Y2, Y3, Y4)3. F1 = Y1 - L1, F2 = Y2 - L2, F3 = Y3 - L2, F4 = Y4 - L4
0
200
400
600
800
1000
1200
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Example: Multiplicative Seasonality
Holt- Winter's Seasonal Exponential Smoothing NB page 201
0.3 One Step Forecast & Error Correction Form Estimation 0.4 Error 0.5
t Season Yt Lt Tt Ft Y(t|t-1) et Lt Tt Ft
1 1 897 564.50 0.00 1.589 564.50 0.00 1.5892 2 476 564.50 0.00 0.843 564.50 0.00 0.8433 3 376 564.50 0.00 0.666 564.50 0.00 0.6664 4 509 564.50 0.00 0.902 564.50 0.00 0.9025 1 967 577.72 5.286 1.6314 897.00 70.00 577.72 5.286 1.63146 2 529 596.31 10.609 0.8652 491.60 37.40 596.31 10.609 0.86527 3 407 608.15 11.104 0.6677 404.25 2.75 608.15 11.104 0.66778 4 371 556.92 -13.833 0.7839 558.37 -187.37 556.92 -13.833 0.78399 1 884 542.72 -13.980 1.6301 886.00 -2.00 542.72 -13.980 1.6301
10 2 407 511.24 -20.977 0.8306 457.45 -50.45 511.24 -20.977 0.830611 3 310 482.48 -24.092 0.6551 327.33 -17.33 482.48 -24.092 0.655112 4 338 450.22 -27.359 0.7673 359.34 -21.34 450.22 -27.359 0.767313 1 900 461.63 -11.850 1.7899 689.32 210.68 461.63 -11.850 1.789914 2 448 476.65 -1.102 0.8853 373.61 74.39 476.65 -1.102 0.885315 3 344 490.42 4.846 0.6783 311.53 32.47 490.42 4.846 0.678316 4 274 453.81 -11.736 0.6856 380.04 -106.04 453.81 -11.736 0.685617 1 740 433.48 -15.173 1.7485 791.26 -51.26 433.48 -15.173 1.748518 2 261 381.27 -29.991 0.7849 370.32 -109.32 381.27 -29.991 0.784919 3 289 373.72 -21.013 0.7258 238.26 50.74 373.72 -21.013 0.725820 4 319 386.49 -7.500 0.7555 241.80 77.20 386.49 -7.500 0.755521 1 1036 443.05 18.123 2.0434 662.66 373.34 443.05 18.123 2.043422 2 602 552.91 54.818 0.9369 361.98 240.02 552.91 54.818 0.936923 3 536 646.96 70.512 0.7771 441.08 94.92 646.96 70.512 0.777124 4 349 640.82 39.851 0.6500 542.03 -193.03 640.82 39.851 0.650025 1 1050 630.62 19.832 1.8542 1390.90 -340.90 630.62 19.832 1.854226 2 633 658.02 22.857 0.9494 609.38 23.62 658.02 22.857 0.949427 3 435 644.54 8.322 0.7260 529.13 -94.13 644.54 8.322 0.726028 4 415 648.53 6.589 0.6450 424.39 -9.39 648.53 6.589 0.6450
Starting Values 1214.731. T1=T2=T3=T4 = 02. L1=L2=L3=L4 = 564.5 = Average (Y1, Y2, Y3, Y4)3. F1 = Y1/ L1, F2 = Y2/ L2, F3 = Y3/ L3, F4 = Y4 / L4
0.00
200.00
400.00
600.00
800.00
1000.00
1200.00
1400.00
1600.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Choosing Smoothing Constants
• Forecast = f(Data, s.c, initial values)
• Big Question:must evolve from using the system
• Recommendation:use small values, say 0.2 to 0.5, to begin with
Using Eviews
• Simple smooth(s, ) ser_name smooth_name
• Holt smooth(n, )
• Holt-Winters smooth(a, additive
smooth(m, multiplicative
Recommended