Statistika
Stat 5188
Single Exponential Smoothing Exponential smoothing memberikan bobot observasi dari data terbaru sampai data terlampau dengan bobot yang menurun secara exponensial untuk memprediksi nilai masa depan (weights past observations with exponentially decreasing weights to forecast future values). Skema Pemulusan ini dimulai dengan menetapkan S2 dengan y1, dimana Si adalah observasi yang telah dihaluskan atau hasil dari pemulusan (EWMA), dan yt adalah data observasi. Subscript menunjuk kepada periode waktu 1, 2, ..., n. Untuk periode ketiga dan seterusnya, digunakan rumus St =αyt-1 + (1-α) St-1. Tidak ada nilai S1; 0<α≤1 Still another possibility would be to average the first four or five observations (Kemungkinan yang lain adalah mengambil nilai awal sama dengan rata-rata 4 atau 5 data pertama). This is the basic equation of exponential smoothing and the constant or parameter α is called the smoothing constant. Why is it called "Exponential"? Let us expand the basic equation by first substituting for St-1 in the basic equation to obtain St = α yt-1 + (1- α)St-1 = α yt-1 + (1- α) [α yt-2 + (1- α) St-2 ] = α yt-1 + α (1- α)1 yt-2 + (1- α)2 St-2 = α yt-1 + α (1- α)1 yt-2 + α (1- α)2 yt-3 +…+ α (1- α)t-3 y2+(1- α)t-2 S2 By substituting for St-2, then for St-3, and so forth, until we reach S2 (which is just y1), it can be shown that the expanding equation can be written as:
For example, the expanded equation for the smoothed value S5 is: S5 = α y4 + α (1- α)1 y3 + α (1- α)2 y2 + (1- α)3 y2 This illustrates the exponential behavior. The weights, α(1-α)t decrease geometrically, and their sum is unity as shown below, using a property of geometric series: The sum of the weights is: + (1 - ) + (1 - )2 + (1 - )3 + ... = / [1 - (1 - )] = 1
UGM
1
Statistika
Stat 5188
From the last formula we can see that the summation term shows that the contribution to the smoothed value St becomes less at each consecutive time period. Let α=.5. Observe that the weights α(1-α)t decrease exponentially (geometrically) with time. Ilustrasi Exponensially alpha 0.5 t yt Bobot 7 y7 0.5 6 y6 0.25 5 y5 0.125 4 y4 0.0625 3 y3 0.03125 2 y2 0.015625 1 y1 0.007813
What is the "best" value for α? The constant influences the accuracy of the forecast. It must therefore be specified to minimize the forecast errors. This can be done by trial and error method over a past time interval. Thus, if the data have substantial fluctuations or randomness, one should use a small value for . On the other hand, data with little randomness or with a clear pattern, need a larger value for . The speed at which the older responses are dampened (smoothed) is a function of the value of α. When α is close to 1, dampening is quick (laju pemulusan cepat) and when α is close to 0, dampening is slow (laju pemulusan lambat). This is illustrated in the table below: towards past observations We choose the best value for α so the value which results in the smallest MSE. (α dipilih yang menghasilkan MSE yang minimum) Let us illustrate this principle with an example. Consider the following data set consisting of 12 observations taken over time:
UGM
2
Statistika
Stat 5188
Pemulusan Exponensial Tunggal Data Stationer Alpha Periode data
0.1
e^2
0.3
e^2
0.7
e^2
0.9
e^2
70
71.00
1.00
71.00
1.00
71.00
1.00
71.00
1.00
3
69
70.95
3.80
70.70
2.89
70.30
1.69
70.10
1.21
4
68
70.85
8.14
70.19
4.80
69.39
1.93
69.11
1.23
5
64
70.71 45.02 69.53
30.61
68.42
19.51
68.11
16.90
6
65
70.37 28.88 67.87
8.25
65.33
0.11
64.41
0.35
7
72
70.11
67.01
24.89
65.10
47.64
64.94
49.83
8
78
70.20 60.83 68.51
90.10
69.93
65.14
71.29
44.97
9
75
70.59 19.44 71.36
13.28
75.58
0.33
77.33
5.43
10
75
70.81 17.55 72.45
6.51
75.17
0.03
75.23
0.05
11
75
71.02 15.84 73.21
3.19
75.05
0.00
75.02
0.00
12
70
71.22
14.06
75.02
25.16
75.00
25.02
13
-
71.16
1
71
2
MSE
3.59
1.49
73.75 72.62
19
71.50
70.50
MSE 18.14 MSE 14.78 MSE 13.27
The sum of the squared errors (SSE) = 208.94. The mean of the squared errors (MSE) is the SSE /11 = 19.0. The MSE was again calculated for α = .9 and turned out to be 13.27, so in this case we would prefer an α of .9. Can we do better? We could apply the proven trial-and-error method. This is an iterative procedure beginning with a range of α between .1 and .9. We determine the best initial choice for α and then search between α -δ and α + δ. We could repeat this perhaps one more time to find the best α to 3 decimal places. But there are better search methods, such as the Marquardt procedure. This is a nonlinear optimizer that minimizes the sum of squares of residuals. In general, most well designed statistical software programs should be able to find the value of α that minimizes the MSE.
UGM
3
Statistika
Stat 5188
Forecasting with Single Exponential Smoothing The forecasting formula is the basic equation St =αyt-1 + (1-α) St-1 This can be written as: St+1 = St+α (et) where et is the forecast error (actual - forecast) for period t. In other words, the new forecast is the old one plus an adjustment for the error that occurred in the last forecast.
Bootstrapping of Forecasts What happens if you wish to forecast from some origin, usually the last data point, and no actual observations are available? In this situation we have to modify the formula to become: St+1 =αyorigin + (1-α) St
where yorigin remains constant. This technique is known as bootstrapping.
UGM
4
Statistika
Stat 5188
Example of Bootstrapping The last data point in the previous example was 70 and its forecast (smoothed value S) was 71.7. Since we do have the data point and the forecast available, we can calculate the next forecast using the regular formula
= .1(70) + .9(71.7) = 71.5 (α = .1) But for the next forecast we have no data point (observation). So now we compute: St+2 =. 1(70) + .9(71.5 )= 71.35 The following table displays the comparison between the two methods: Period Bootstrap Data Single Smoothing forecast Forecast 13 14 15 16 17
71.50 71.35 71.21 71.09 70.98
75 75 74 78 86
UGM
5
71.5 71.9 72.2 72.4 73.0
Statistika
Stat 5188
Single Exponential Smoothing with Trend Single Smoothing (short for single exponential smoothing) is not very good when there is a trend. The single coefficient α is not enough. Let us demonstrate this with the following data set smoothed with an α of 0.3: Data
Fit
6,4 5,6 7,8 8,8 11 11,6 16,7 15,3 21,6 22,4
6,4 6,2 6,7 7,3 8,4 9,4 11,6 12,7 15,4
The resulting graph looks like:
Exponential Smoothing: This is a very popular scheme to produce a smoothed Time Series. Whereas in Moving Averages the past observations are weighted equally, Exponential Smoothing assigns exponentially decreasing weights as the observation get older. In other words, recent observations are given relatively more weight in forecasting than the older observations. Double Exponential
UGM
6
Statistika
Stat 5188
Smoothing is better at handling trends. Triple Exponential Smoothing is better at handling parabola trends.
Adaptive Response Rate Exponential Smoothing In order to facilitate specification of and to improve alertness ability of the predictor, a number of adaptive methods have been proposed in the literature. The most representative and widely used is the Trigg and Leach formula:
where
Ft+1 = tXt + (1 - t) Ft
(1)
t+1 = Et / Mt
(2)
Et = et + (1 - ) Et-1 (3) Mt = et + (1 - ) Mt-1
(4)
et = Xt - Ft
(5)
The parameter is usually set at 0,1 or 0,2. Finally, t+1 is computed instead of t to allow the system to „settle” a little by not being too responsive to changes. Most importantly, t will vary according to (2), based on variations in the pattern of the data. If Et and Mt are about equal, this means that (1) forecasts in such a way that no obvious bias of under or overestimating occurs. Thus, a value of t close to one will result. The same high value of t will result when the magnitude of errors e t-1 is small since in this case Mt will not be too different than Et. Initial Value Nilai awal yang sering digunakan adalah sebagai berikut F2 = X1 ; 2 = 3 =4 =0,2 = . M1 = E1=0. Tentu saja, kita diberikan kebebasan untuk menentukan nilai awal yang berbeda dengan nilai awal di atas selama pemberian nilai awal tersebut berdasarkan prinsip-prinsip ilmiah dan mampu memberikan nilai error yang relative kecil.
UGM
7
Statistika
Stat 5188
Data Trend beta Periode
data
1
10
6.4 5.6 7.8 8.8 11 11.6 16.7 15.3 21.6 22.4
11
-
2 3 4 5 6 7 8 9
forecst
0.15
e
Et
Mt
0.00
0.00
alpha_t
e^2
6.40
-0.80
-0.12
0.12
0.20
0.64
6.24
1.56
0.13
0.34
0.25
2.43
6.63
2.17
0.44
0.61
0.40
4.71
7.50
3.50
0.90
1.04
0.72
12.26
10.01
1.59
1.00
1.13
0.86
2.54
11.38
5.32
1.65
1.76
0.89
28.35
16.11
-0.81
1.28
1.61
0.94
0.65
15.35
6.25
2.03
2.31
0.79
39.08
20.31
2.09
2.04
2.28
0.88
4.36
22.14
0.89
M SE
9.50
Langkah perhitungannya dapat diterangkan sebagai berikut: Dari inisial value F2 = X1 ; 2 = 3 =4 =0,2 = . M1 = E1=0, dapat dihitung e2, Selanjutnya dihitung E2 dan M2. Dengan menggunakan parameter = 0,2 dan nilai awal seperti di atas diperoleh nilai MSE 9,97. Jika menggunakan nilai = 0,1 diperoleh nilai MSE 9,96. Sedangkan jika diambil nilai = 0,15, diperoleh nilai MSE 9,95. Selanjutnya jika anda coba beberapa variasi nilai awal untuk 2 = 3 =0,25 dengan = 0,15 akan memberikan nilai MSE yang lebih kecil lagi, 9,78.
UGM
8