You are on page 1of 49

Prof. Nur Iriawan; Dr. Brodjol S.U.; Dr.

Suhartono;
Dr. Irhamah; Dr. Heri Kuswanto

Lecturer, Department of Statistics,
Faculty of Mathematics and Science, ITS Surabaya
for TIME SERIES ANALYSIS
25-26 November 2011
Department of Statistics, 3
rd
Floor of U Building, ITS
Surabaya
Materi : Metode Peramalan

1. Pendahuluan
2. Moving Average Methods
3. Exponential Smoothing Methods
4. Trend Analysis
5. Metode Dekomposisi
6. Model ARIMA Box-Jenkins
7. Studi Kasus : Model ARIMAX (Analisis Intervensi, Fungsi
Transfer dan lain-lain)
Buku Acuan (Referensi Utama) :

1. Hanke, J.E. and Reitsch, A.G. (1995 & 2001)
Business Forecasting, 5
th
and 7
th
edition, Prentice Hall.

2. Bowerman, B.L. and OConnell, R.T. (1993)
Forecasting and Time Series: An Applied Approach,
3
rd
edition, Duxbury Press: USA.

3. Makridakis, S., Wheelwright, S. C. and Hyndman, R. J. (1998)
Forecasting: Method and Applications, New York: Wiley & Sons.

4. Cryer, J.D. (1986)
Time Series Analysis, Boston: PWS-KENT Publishing Company.

5. Wei, W.W.S. (2006)
Time Series Analysis: Univariate and Multivariate Methods
Addison-Wesley Publishing Co., USA.
Ilustrasi Matematis : Klasifikasi Metode Peramalan
Forecasting Method
Objective
Forecasting Methods
Subjective (Judgmental)
Forecasting Methods
Time Series Methods
Y
t
= f (Y
t-1
, Y
t-2
, , Y
t-k
)
Causal Methods
Y
t
= f (X1
t
, X2
t
, , Xk
t
)
Examples :
sales
(t)
= f (sales
(t-1)
, sales
(t-2)
, )
Examples :
sales
(t)
= f (price
(t)
, advert
(t)
, )
Combination of Time Series Causal Methods
Y
t
= f (Y
t-j
, j>0 ; X
t-i
, i>0)
Examples :
sales
(t)
= f (sales
(t-1)
, advert
(t)
, advert
(t-1)
, )
Klasifikasi Model Time Series untuk Peramalan
(Berdasarkan Bentuk atau Fungsi dari Model Matematis)
TIME SERIES MODELS
LINEAR
Time Series Models
NONLINEAR
Time Series Models
ARIMA Box-Jenkins
Models from time series theory
nonlinear autoregressive, etc ...
Flexible statistical parametric models
neural network model, etc ...
State-dependent, time-varying para-
meter and long-memory models
Nonparametric models
Intervention Model
Transfer Function (ARIMAX)
VARIMA (VARIMAX)
Models from economic theory
References :
Timo Terasvirta, Dag Tjostheim and Clive W.J. Granger, (1994)
Aspects of Modelling Nonlinear Time Series
Handbook of Econometrics, Volume IV, Chapter 48.
Edited by R.F. Engle and D.I. McFadden
Klasifikasi Pola Data atau Pattern pada Time Series
Time Series Patterns
Stationer Trend Effect Seasonal Effect Cyclic Effect
Fakta :
Dalam praktek, pola data time series yang ada seringkali mengandung kombinasi
(additive atau multiplicative) antar 4 (empat) pola data itu, misal kombinasi TREND,
SEASONAL, dan CYCLIC.
Contoh kasus di Indonesia : Indeks Harga Konsumen (IHK Umum), Jumlah penumpang
pesawat udara, Jumlah wisatawan yang datang ke Bali, Pemakaian pulsa telkom, dll
Case Study : Trend and Seasonal problem ?

Ada data penjualan bulanan salah satu produk
GENTENG yang diproduksi oleh CV CAHAYA PURNAMA
di SIDOARJO selama 25 bulan pengamatan, yaitu
mulai Januari 2003 sampai dengan Januari 2005. (TA
Si X, 2005)
Bagian PPIC akan melakukan perencanaan produksi
dan meminta bantuan anda untuk mendapatkan
ramalan penjualan genteng itu pada tahun 2005 dan
seterusnya. Metode mana menurut anda yang akan
menghasilkan ramalan dengan kesalahan terkecil ?
Data penjualan bulanan genteng tipe WWW
12
12
11
11
Winters model solution
12
12 12
Case Study : Trend and Change Trend problem ?

Data produksi tahunan bunga anggrek propinsi JAWA TIMUR
yang diperoleh dari Departemen Pertanian mulai 1995 sampai
dengan 2004. (TA Si Y, 2005)
Seorang analisis perencana industri agribisnis ingin melakukan
analisis berkaitan dengan demand anggrek JATIM pada tahun-
tahun yang akan datang.
Karena data demand tidak diperoleh, maka digunakan data
produksi sebagai proxi dari demmand yang ada.
Selama periode itu, Indonesia mengalami krisis ekonomi
yang banyak mempengaruhi pola produksi dan konsumsi
dari beberapa produk yang ada, termasuk bunga anggrek.
Metode mana menurut anda yang akan menghasilkan ramalan
dengan kesalahan terkecil ?
Data produksi bunga anggrek JAWA TIMUR
Periode sebelum krisis Periode setelah krisis
Case Study : Seasonal or Calendar Variation problem ?

Berikut ini adalah data penjualan bulanan (kuartalan) salah satu
produk SARDEN yang diproduksi oleh pabrik di BANYUWANGI
selama 5 tahun pengamatan, yaitu mulai tahun 2000 sampai
dengan 2004.
Produk ini biasanya akan mengalami penjualan yang
meningkat cukup besar, terutama pada bulan menjelang
hari raya Idul Fitri.
Di Indonesia, hari raya Idul Fitri tidak mengikuti kalender
masehi, sehingga terjadi pergeseran bulan dimana hari raya
tersebut terjadi.
Bagian PPIC akan melakukan perencanaan produksi dan meminta
bantuan anda untuk mendapatkan ramalan penjualan kedua ban
itu pada tahun 2005 dan seterusnya. Metode mana menurut anda
yang akan menghasilkan ramalan dengan kesalahan terkecil ?
Data penjualan bulanan sarden ABC
12
11
11
11
10
Measuring Forecasting Error

MSE/MSD (mean squared error)
rata-rata kuadrat kesalahan (residual atau error).

MAD (mean absolute deviation)
ukuran kesalahan peramalan dalam unit ukuran yang
sama dengan data aslinya.

MAPE (mean absolute percentage error)
persentase kesalahan absolut rata-rata.

MPE (mean percentage error)
persentase kesalahan rata-rata.
Average Methods

1. Simple Averages
obtained by finding the mean for all the relevant values and
then using this mean to forecast the next period.




2. Moving Averages
obtained by finding the mean for a specified set of values
and then using this mean to forecast the next period.

=
+
=
n
t
t
t
n
Y
Y
1
1

n
Y Y Y
Y M
n t t t
t t
) (

1 1
1
+
+
+ + +
= =

for stationary data
for stationary data
Average Methods (continued)

3. Double Moving Averages
one set of moving averages is computed, and then a second set
is computed as a moving average of the first set.

(i).

(ii).

(iii).

(iv).


p b a Y
t t p t
+ =
+

n
Y Y Y
Y M
n t t t
t t
) (

1 1
1
+
+
+ + +
= =

for a linear trend data
n
M M M
M
n t t t
t
) (
1 1 +
+ + +
= '

t t t
M M a ' = 2
) (
1
2
t t t
M M
n
b '

=
Exponential Smoothing Methods

Single Exponential Smoothing for stationary data


Exponential Smoothing Adjusted for Trend : Holts Method
1. The exponentially smoothed series :
A
t
= o Y
t
+ (1o) (A
t-1
+ T
t-1
)

2. The trend estimate :
T
t
= | (A
t
A
t-1
) + (1 |) T
t-1

3. Forecast p periods into the future :

t t t
Y Y Y

) 1 (

1
o o + =
+
t t p t
pT A Y + =
+

Exponential Smoothing Adjusted for Trend and


Seasonal Variation : Winters Method

1. The exponentially smoothed series :



2. The trend estimate :


3. The seasonality estimate :



4. Forecast p periods into the future :
) ( ) 1 (
1 1

+ + =
t t
L t
t
t
T A
S
Y
A o o
1 1
) 1 ( ) (

+ =
t t t t
T A A T | |
1
) 1 (

+ =
t
t
t
t
S
A
Y
S
p L t t t p t
S pT A Y
+ +
= ) (

Three
parameters
models
Model-model Time Series Regression

1. Model Regresi untuk LINEAR TREND
Y
t
= a + b.t + error t = 1, 2, (dummy waktu)

2. Model Regresi untuk Data SEASONAL (variasi konstan)
Y
t
= a + b
1
D
1
+ + b
S-1
D
S-1
+ error
dengan : D
1
, D
2
, , D
S-1
adalah dummy waktu dalam
satu periode seasonal.

3. Model Regresi untuk Data dengan LINEAR TREND dan
SEASONAL (variasi konstan)
Y
t
= a + b.t + c
1
D
1
+ + c
S-1
D
S-1
+ error
Gabungan model 1 dan 2.
Kaitan Pola Data dan Metode Dekomposisi
Dekomposisi Adititif
(Trend & Seasonal)
Constant Variation
Dekomposisi Multiplikatif
(Trend & Seasonal)
Unconstant Variation
Model Dekomposisi MULTIPLIKATIF

Bentuk umum Model dekomposisi multiplikatif
Y
t
= T
t
S
t
C
t
I
t
dengan :

Y
t
= Nilai pengamatan waktu ke-t
T
t
= Komponen (faktor) trend waktu ke-t
S
t
= Komponen (faktor) musim waktu ke-t
C
t
= Komponen (faktor) siklus waktu ke-t
I
t
= Komponen (faktor) irregular waktu ke-t

PEMODELAN ARIMA
Kestasioneran
Identifikasi
Estimasi
Forecasting

Sample Autocorrelation Function (ACF)
For the working series Z
1
, Z
2
, , Z
n
:
ACF for stationary time series
1
-1
0
Lag k
8
1
-1
0
Lag k
8
1
-1
0
Lag k
8
1
-1
0
Lag k
8
cuts off
dies down
(exponential)
dies down
(exponential)
dies down
(sinusoidal)
no oscillation
oscillation
Dying down fairly quickly versus extremely slowly
Dying down fairly quickly
Lag k
8
1
-1
0
Lag k
8
1
-1
0
Dying down extremely slowly
stationary time
series (usually)
nonstationary time
series (usually)
Sample Partial Autocorrelation Function (PACF)
For the working series Z
1
, Z
2
, , Z
n
: Corr(Z
t
,Z
t-k
|Z
t-1
,,Z
t-k+1
)
General Theoretical ACF and PACF of ARIMA Models
Model ACF PACF
MA(q): moving average of order q Cuts off Dies down
after lag q
AR(p): autoregressive of order p Dies down Cuts off
after lag p
ARMA(p,q): mixed autoregressive- Dies down Dies down
moving average of order (p,q)
AR(p) or MA(q) Cuts off Cuts off
after lag q after lag p
No order AR or MA No spike No spike
(White Noise or Random process)
Theoretically of ACF and PACF of First-order Moving
Average Model or MA(1)
The model
Z
t
= o + a
t
u
1
a
t-1
, where o =
Invertibility condition : 1 < u
1
< 1

Theoretically of ACF
Theoretically of PACF
Theoretically of ACF and PACF of The First-order
Autoregressive Model or AR(1)
The model
Z
t
= o + |
1
Z
t-1
+ a
t
, where o = (1-|
1
)
Stationarity condition : 1 < |
1
< 1

Theoretically of ACF
Theoretically of PACF
Theoretically of ACF and PACF of The First-order
Autoregressive Model or AR(1) [Graphics illustration]
ACF
PACF
ACF
PACF
Theoretically of ACF and PACF of The Mixed Autoregressive-
Moving Average Model or ARMA(1,1)
The model
Z
t
= o + |
1
Z
t-1
+ a
t
u
1
a
t-1
, where o = (1|
1
)
Stationarity and Invertibility condition : ||
1|
< 1
and |u
1
| < 1
Theoretically of ACF
Theoretically of PACF
Dies Down (in fashion
dominated by
damped
exponentials decay)
Theoretically of ACF and PACF of The Mixed Autoregressive-
Moving Average Model or ARMA(1,1) [Graphics illustration] (1)
ACF PACF
ACF
PACF
Theoretically of ACF and PACF of The Mixed Autoregressive-
Moving Average Model or ARMA(1,1) [Graphics illustration] (2)
ACF
PACF
ACF
PACF
Theoretically of ACF and PACF of The Mixed Autoregressive-
Moving Average Model or ARMA(1,1) [Graphics illustration] (3)
ACF
PACF
ACF
PACF
Estimation and Testing parameter ARIMA model
t-values and prob-values for testing parameter model ARIMA
Parameters
ARIMA
model estimates
Diagnostic Checking of ARIMA model [white noise residual]
Ljung-Box statistic for testing white noise residual
ACF of
residual
Forecasting of ARIMA(p,d,q) model
Forecasting of AR(1) model
or
Forecasting of MA(1) model
Implementasi Time Series pada R
Hasil Plot
Regresi Time Series
Reg. Time Series (Kuadratik)
Pemodelan ARIMA dg R
Estimasi Parameter
Diagnostik Residual
Scrip Time Series Data Price Y10

Scrip Data Price Y10 (cont..)

25-26 November 2011
Department of Statistics, 3
rd
Floor of U Building, ITS
Surabaya

You might also like