Kuliah 2 Metode Peramalan Deret Waktu rahmaanisa@apps.ipb.ac.id
REVIEW Tentukan pola dari data deret waktu berikut: Gambar (1) Gambar (2) Gambar (3) Gambar (4) 2
Kriteria kebaikan peramalan data deret waktu MAD MAPE MSE AIC 3
Data deret waktu stasioner (tanpa tren) Pemulusan rataan bergerak sederhana (RBS) Peramalan melalui RBS Data deret waktu tak-stasioner (ada tren) Pemulusan rataan bergerak ganda (RBG) Peramalan melalui RBG Contoh aplikasi pada data 4
5
A time series is said to be strictly stationary if its properties are not affected by a change in the time origin. Montgomerry (2015) 6
7
8
9
10
11
Plotting smoothed data Overlay a smoothed version of the original data help reveal patterns in the original data The simplest approach: moving average 12
13
Bagaimana akurasi dari peramalannya? 14
Single Moving Average Double Moving Average 15
16
Note that the smoothed data will have less variance*: *assuming independence between observations. 17
F t = M t 1 Sedangkan untuk periode ke-n: F n,h = M n Artinya, peramalan untuk periode selanjutnya adalah konstan. 18
Single moving average of order three: 19
Monthly Time Periods Sales (units) Jan 10 Feb 9 Mar 8 10+9+8 3 9+8+7 MA(3) Forecast Error = 9.00 Apr 7 3 = 8.00 9.00-2.00 May 3 6.00 8.00-5.00 Jun 2 4.00 6.00-4.00 Jul 1 2.00 4.00-3.00 Aug 0 1.00 2.00-2.00 Sep 1 0.67 1.00 0.00 Oct 5 2.00 0.67 4.33 Nov 12 6.00 2.00 10.00 Dec 14 10.33 6.00 8.00 Forecast 10.33 20
16 14 12 10 8 6 4 2 0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Sales (units) Forecast 21
Monthly Time Periods Sales (units) MA(5) Forecast Jan 10 Feb 9 Mar 8 Apr 7 May 3 7.4 Jun 2 5.8 7.4 Jul 1 4.2 5.8 Aug 0 2.6 4.2 Sep 1 1.4 2.6 Oct 5 1.8 1.4 Nov 12 3.8 1.8 Dec 14 6.4 3.8 Forecast 6.4 23
16 14 12 10 8 6 4 2 0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Sales (units) Forecast 24
26
27
an outlier will dominate the moving averages that contain that observation 250 200 150 100 50 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Actual Forecast 28
Moving Median Centered Moving Average 29
SUPPLEMENTARY TOPICS Odd-span moving medians (also called running medians) are an alternative to moving averages that are effective data smoothers when the time series may be contaminated with unusual values or outliers. The moving median of span N is defined as where N = 2u + 1. The median is the middle observation in rank order (or order of value). The moving median of span 3 is a very popular and effective data smoother, where 30
SUPPLEMENTARY TOPICS This is common for even numbers of observations. Monthly Time Periods Sales (units) Jan 10 Feb 9 10+9+8 3 9+8+7 MA(3) = 9.00 Forecast Mar 8 3 = 8.00 9.00 Apr 7 6.00 8.00 May 3 4.00 6.00 Jun 2 2.00 4.00 Jul 1 1.00 2.00 Aug 0 0.67 1.00 Sep 1 2.00 0.67 Oct 5 6.00 2.00 Nov 12 10.33 6.00 Dec 14 10.33 Forecast 10.33 31
SUPPLEMENTARY TOPICS 16 14 12 10 8 6 4 2 0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Sales (units) Forecase (centered) Forecast 32
SUPPLEMENTARY TOPICS 33
34
A time series that exhibits a trend is a nonstationary time series. 35
A double moving average may be used for additional smoothing of a single moving average. 36
1. Compute a single moving average (S 1 ) of order T 2. A second moving average (S 2 ) series is calculated from the first moving average, is of order N 37
dengan: a t = 2 S 1,t S 2,t b t = 2 S N 1 1,t S 2,t 38
Period Data Series 1 34 2 36 3 38 4 40 5 42 6 44 7 46 8 48 9 50 10 52 Langkah 1: Lakukan pemulusan single moving average (misal, T=3): misal: S 1,t = 1 3 y t 2 + y t 3 + y t S 1,3 = 1 3 y 1 + y 2 + y 3 S 1,3 = 1 34 + 36 + 38 3 S 1,3 = 36 39
Period Data Series S 1 1 34 2 36 3 38 36 4 40 38 5 42 40 6 44 42 7 46 44 8 48 46 9 50 48 10 52 50 Langkah 2: Lakukan pemulusan single moving average (misal, N=3): misal: S 2,t = 1 3 S t 2 + S t 3 + S t S 2,5 = 1 3 S 3 + S 4 + S 5 S 1,3 = 1 36 + 38 + 40 3 S 1,3 = 38 40
Menghitung Forecasts: Period Data Series S 1 S 2 1 34 2 36 3 38 36 4 40 38 5 42 40 38 6 44 42 40 7 46 44 42 8 48 46 44 9 50 48 46 10 52 50 48 a t = 2 S 1,t S 2,t b t = 2 S N 1 1,t S 2,t misal utk t=5, a 5 = 2 S 1,5 S 2,5 a 5 = 2 40 38 a 5 = 42 b 5 = 2 S 3 1 1,5 S 2,5 b 5 = 2 40 38 3 1 b 5 = 2 41
Period Data Series S 1,t S 2,t a t b t 1 34 2 36 3 38 36 4 40 38 5 42 40 38 42 2 6 44 42 40 44 2 7 46 44 42 46 2 8 48 46 44 48 2 9 50 48 46 50 2 10 52 50 48 52 2 Menghitung Forecasts: F t+h = a t + b t h F 6 = F 5+1 = a 5 + b 5 1 = 42 + 2 1 = 44 42
Period Data Series S 1,t S 2,t a t b t F t 1 34 2 36 3 38 36 4 40 38 5 42 40 38 42 2 44 6 44 42 40 44 2 46 7 46 44 42 46 2 48 8 48 46 44 48 2 50 9 50 48 46 50 2 52 10 52 50 48 52 2 44 11 54 Menghitung Forecasts: F t+h = a t + b t h F 6 = F 5+1 = a 5 + b 5 1 = 42 + 2 1 = 44 43
Two-sided Moving Average Weighted Moving Average 44
45
Perhatikan kembali ilustrasi-1 dan ilustrasi-2. Hitung MAPE, MAD, dan MSE dari masing-masing kasus tersebut. Menurut Anda, mana yang lebih baik di antara keduanya? 46
Berikut disajikan data penjualan mobil di Carmen s Chevrolet. Lakukan pemulusan rataan bergerak tunggal dengan periode 3 minggu. Week 1 2 3 4 5 6 7 Auto Sales 8 10 9 11 10 13 - a) Berapa nilai hasil peramalan pada minggu ke -7 menggunakan metode rataan bergerak dengan periode 3 minggu? b) Buatlah sketsa data aktual dan data hasil pemulusan 47
Volume ekspor karet mentah Indonesia ke Negara Asia selama 11 tahun terakhir disajikan dalam table dibawah ini: Tahun 1998 1999 2000 2001 2002 2003 Ekspor (ribuan ton) 97.43 96.22 98.29 98.61 97.19 99.58 Tahun 2004 2005 2006 2007 2008 Ekspor (ribuan ton) 101.03 100.04 102.6 101.3 101.81 Gambarkan plot data ekspor ini terhadap tahun. Apa penjelasan Anda mengenai perilaku ekspor tersebut? Berdasarkan pola data tersebut, menurut Anda, metode pemulusan mana yang lebih tepat utk digunakan pada data tsb? (Single atau Double Moving Average) 48
Hyndman, R.J. 2010. Moving Averages. Contribution to the International Encyclopedia of Statistical Science, ed. Miodrag Lovric, Springer. pp.866-869. https://robjhyndman.com/papers/movingaverage.pdf [diakses pada 13 Februari 2018] Montgomery, D.C., Jennings, C.L., Kulahci, M. 2015.Introduction to Time Series Analysis and Forecasting, 2 nd ed. New Jersey: John Wiley & Sons. Yaffee, R.A., McGee, M. 2000. Introduction to Time Series Analysis and Forecasting with Applications of SAS and SPSS. San Diego: Academic Press. 49