Professional Documents
Culture Documents
200,000
150,000
100,000
50,000
5 0 6
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
7 8
• A moving average of order K calculates the average for
• A series is locally constant if the mean level changes the last K periods:
gradually over time but there is no reason to expect a
systematic increase or decrease. Series may change Yn Yn 1 Yn
MA(t | K ) K 1
level / behavior over time. K
o Global averages apply weight (1/n) to each
observation • At each point in time, we drop the oldest observation
• We may apply greater weight to the recent past to and add a new one.
capture such changes. Trade off: • Large values of K produce smoother plots but are slower
o catching new trends [quick adjustment] against to adapt to changes.
o spurious movements in response to random • The forecast for period (t+1) is Ft 1 MA(t | K )
movements [slow adjustment]
9 10
55,000
Sales
50,000 Adding one new observation! How updated mean will be?
45,000
Y1 Y2 Yn Yn 1
Y n 1
40,000 n 1
Yn 1 Y (n)
Y n
35,000
n 1
© Cengage Learning 2013.
30,000
Ft 1
Ft (Yt 1
Ft ) Ft Et
Ft 1
Yt (1 )Yt 1
Ft 1
Ft Yt 1
Ft (1 2
) Yt 2
Ft 1
* Yt (1 )Ft (1 3
) Yt ...
3
F2 Y1 for initialization 17 18
# Term α=0.1 α=0.2 α=0.3 α=0.4 α=0.5 α=0.6 α=0.7 α=0.8 α=0.9
1 Xt 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000
2 Xt-1 0.0900 0.1600 0.2100 0.2400 0.2500 0.2400 0.2100 0.1600 0.0900
3 Xt-2 0.0810 0.1280 0.1470 0.1440 0.1250 0.0960 0.0630 0.0320 0.0090
4 Xt-3 0.0729 0.1024 0.1029 0.0864 0.0625 0.0384 0.0189 0.0064 0.0009
• A smaller value of gives a smoother trend line:
5 Xt-4 0.0656 0.0819 0.0720 0.0518 0.0313 0.0154 0.0057 0.0013 0.0001
o = 0.1 gives slow adjustment 6 Xt-5 0.0590 0.0655 0.0504 0.0311 0.0156 0.0061 0.0017 0.0003 0.0000
o = 0.9 gives rapid adjustment 7 Xt-6 0.0531 0.0524 0.0353 0.0187 0.0078 0.0025 0.0005 0.0001 0.0000
8 Xt-7 0.0478 0.0419 0.0247 0.0112 0.0039 0.0010 0.0002 0.0000 0.0000
9 Xt-8 0.0430 0.0336 0.0173 0.0067 0.0020 0.0004 0.0000 0.0000 0.0000
10 Xt-9 0.0387 0.0268 0.0121 0.0040 0.0010 0.0002 0.0000 0.0000 0.0000
11 Xt-10 0.0349 0.0215 0.0085 0.0024 0.0005 0.0001 0.0000 0.0000 0.0000
12 Xt-11 0.0314 0.0172 0.0059 0.0015 0.0002 0.0000 0.0000 0.0000 0.0000
13 Xt-12 0.0282 0.0137 0.0042 0.0009 0.0001 0.0000 0.0000 0.0000 0.0000
14 Xt-13 0.0254 0.0110 0.0029 0.0005 0.0001 0.0000 0.0000 0.0000 0.0000
15 Xt-14 0.0229 0.0088 0.0020 0.0003 0.0000 0.0000 0.0000 0.0000 0.0000
19
20
The effect of smoothing constant on data weight in Exponential smoothing
1
0.9
0.8
0.6
0.7
0.5
0.6
0.4
weight (α=0.2)
0.5
0.2
0.3
0.1 0.2
0 0.1
1 3 5 7 9 11 13 15 17 19 21
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
© Cengage Learning 2013.
21 α=0.1 α=0.2 α=0.5 α=0.8 α=0.9 22
Ft h (h) Ft 1 (1) Ft 1
27 28
• Choose α to minimize RMSE, MAE or MAPE for the • For model development purposes, a time series is
estimation sample; results tend to be similar. typically divided into two parts:
o Text uses RMSE unless stated otherwise. o The first part, the estimation or fitting sample, is
• (R)MSE corresponds to the use of Least Squares. used to estimate the parameters of the forecast
• Choose the starting value. function.
o Choose first observation o The second part, the hold-out or test sample is
used to check the performance of the forecasting
o Choose the average of time series method.
• Measures of performance based upon the estimation
sample are known as in-sample measures.
• Measures of performance based upon the holdout
sample are known as out-of-sample measures.
29 30
31 32
Table 3.6: Effects of fitting using different methods
33 34
• When a time series has a long-term trend (e.g. Quarterly Sales = - 6.157 + 4.567 Period
increases in GDP or sales) the forecasting method must 80
S 5.47757
accommodate such features. There are two main 70 R-Sq
R-Sq(adj)
93.7%
93.3%
approaches: 60
50
o Convert the series to rates of change (growth rates, 40
Netflix Sales
either absolute or percentage) then predict the rate of 30
change, OR 20
0 2 4 6 8 10 12 14 16
Period
Data: Netflix_1.xlsx. ©Cengage Learning 2013.
35 36
Figure 3.8B: Quadratic trend fitted to Quarterly
Sales
Ft First moving average
Quarterly Sales = 6.914 - 0.0466 Period
+ 0.2883 Period**2 (Yt Yt 1
Yt 2
... Yt n 1
)/n
80
S 1.98024
70 R-Sq 99.2% Ft Second moving average
R-Sq(adj) 99.1%
60
50
(Ft Ft 1
Ft 2
...Ft n 1
)/n
Netflix Sales 40
at 2Ft Ft
30
20 2
bt (Ft Ft )
10
(n 1)
Fˆt
0
0 2 4 6 8
Period
10 12 14 16
m
at bt * m
Data: Netflix_1.xlsx. ©Cengage Learning 2013.
37 38
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
b0 20588.71212
b1 8777.993007
ค่าใช้ จ่าย Ft (regression) Ft(LMA)
39 40
• Brown method is one parameter model Ft Yt (1 )Ft 1
times
41 42
year ค่าใช ้จ่าย SES(α=.712) error(SES) DES(α=.712) error(DES) at bt Ft ค่าใช้ จ่ายโครงการหลักประกันสุขภาพถ้ วนหน้ า
2545 27,612 180,000
2546 30,538 27,612 2,926
2547 33,573 29,695 3,878 27,612 2,083 31,779 5,150 160,000
2548 40,890 32,456 8,434 29,095 3,361 35,817 8,309 36,929
2549 54,429 38,461 15,968 31,488 6,973 45,434 17,238 44,126 140,000
2550 67,366 49,830 17,536 36,453 13,377 63,208 33,072 62,672
2551 76,599 62,316 14,283 45,978 16,338 78,654 40,391 96,279 120,000
2552 80,598 72,485 8,113 57,610 14,875 87,361 36,775 119,045
2553 101,058 78,262 22,796 68,201 10,060 88,322 24,871 124,135 100,000
2554 107,814 94,493 13,321 75,364 19,128 113,621 47,290 113,193
2555 108,744 103,977 4,767 88,984 14,994 118,971 37,068 160,911 80,000
2556 114,963 107,371 7,592 99,659 7,712 115,083 19,066 156,039
2557 115,176 112,777 2,399 105,150 7,626 120,403 18,854 134,149 60,000
2558 114,485 110,580 3,905 118,390 9,654 139,257
2559 128,043 40,000
2560 137,697
20,000
2561 147,350
α=.712
0
2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561
Actual Ft(Brown)
44
43
45 46
at Yt (1 )(Ft 1
bt 1
)
bt (at at 1
) (1 )(bt 1
)
• Holt method is two parameter model with Fˆ at bt * m
t m
level (α) and trend (γ) smoothing Initialization
parameters. (Y2 Y1 ) (Y4 Y3 )
• If α= γ, then Holt = Brown b1
2
or
b1 Y2 Y1
a1 Y1
47 48
# year Actual at bt Ft (Holt; γ=0.05 & α=0.95)
ค่ าใช้ จ่ายโครงการหลักประกันสุขภาพถ้ วนหน้ า
1 2545 27612 27612 2926
160,000
2 2546 30538 30538 2926 30538
15 2559 125154 0
2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561
16 2560 130022
Actual Ft (Holt; β=0.05 & α=0.95)
17 2561 134890
49 50
alpha 0.95
gamma 0.05
51 52
Netflix Sales Forecast
90
80
70
60
50
40
30
20
10
0
0 4 8 12 16
53 54
55 56
• Compute growth rates (Figure 3.11) Yt Yt 1
• Transform to logarithms (Figure 3.12) • Define the growth rate as: Gt 100*
Yt 1
• Use a power transform [C transform; see Figure 3.12]
o Growth rates and differences are ways to remove trends • After forecasting the growth rate as gt+1, then convert
o Logarithmic and power transforms are ways to stabilize back to the original series:
the variance gt 1
Ft 1
Yt 1
100
57 58
61 62
63