Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Forecasting
Forecasting
6/3/2008
Mengapa
g p Mempelajari
p j Analisis
Runtut Waktu?
Karena dengan
K
d
mengamati
ti data
d t runtut
t t waktu
kt akan
k
terlihat empat komponen yang mempengaruhi suatu
pola data masa lalu dan sekarang, yang cenderung
berulang dimasa mendatang
6/3/2008
Teknik Forecasting
Pendekatan Basis
Teknik
Hasil
Peramalan
ekstrapolatif
Ekstrapolasi
trend
Analisis rangkaian-waktu
Teknik benang-hitam
Teknik OLS
Pembobotan eksponensial
Transformasi data
Metode katastrofi
Projeksi
Peramalan
Teoretis
Teori
Pemetaan teori
Analisis jalur
Analisis Input
Input-Output
Output
Pemrograman linier
Analisis regresi
Estimasi interval
Analisis hubungan
Prediksi
Peramalan
intuitif
Penilaian
subjektif
Delphi konvensional
Delphi kebijakan
Analisis dampak-silang
Penilaian kelayakan
Konjektur
6/3/2008
Objective
Forecasting Methods
Time Series
M th d
Methods
Causal
Methods
M
th d
Analogies
Nave Methods
Simple Regression
Moving Averages
Multiple Regression
Exponential Smoothing
Neural Networks
Delphi
PERT
Simple Regression
Survey techniques
ARIMA
Neural Networks
References :
Combination of Time Series Causal Methods
6/3/2008
Intervention Model
Transfer Function (ARIMAX)
VARIMA (VARIMAX)
Neural Networks
Makridakis et al.
Hanke and Reitsch
Wei, W.W.S.
B
Box,
JJenkins
ki and
d Reinsel
R i
l
Ilustrasi
M d l Matematis
Model
M
i
Forecasting Method
Objective
Subjective
(Judgmental)
Examples :
sales
l
= f (price
( i
, advert
d
t , ))
Forecasting Methods Forecasting Methods
Examples :
sales
l (t) = f (sales
( l (t-1), sales
l (t-2), ))
(t)
(t)
(t)
Examples :
Time Series Methods
Causal
Methods
, advert , advert
, )
sales = f (sales
(t)
(t-1)
(t)
(t-1)
NONLINEAR
Time Series Models
ARIMA Box-Jenkins
Intervention Model
VARIMA (VARIMAX)
References :
Timo Terasvirta, Dag Tjostheim and Clive W.J. Granger, (1994)
Aspects of Modelling Nonlinear Time Series
6/3/2008
Handbook of Econometrics, Volume IV, Chapter 48.
Edited by R.F. Engle and D.I. McFadden
Nonparametric models
6/3/2008
6/3/2008
10
6/3/2008
11
6/3/2008
12
6/3/2008
13
MODEL
O
PERAMALAN RUNTUT
U U WAKTU
U
DENGAN ATAU TANPA TREN
RUNTUT
U U WKATU
U
EXPONENTIAL
SMOOTING
MENGANDUNG
UNSUR TREND
TIDAK
MOVING
AVERAGE
YA
TREND LINEAR
6/3/2008
TREND
KUADRATIK
TREND
EKSPONENSIAL
MODEL
AUTOREGRESIF
14
15
Stationer
9 Nonseasonal
Stationaryy models
6/3/2008
Trend Effect
Seasonal Effect
9 Nonseasonal
Nonstationaryy models
9 Seasonal and
p
models
Multiplicative
Cyclic Effect
9 Intervention
models
16
Pola data
General Time Series PATTERN
Stationer
St ti
Trend (linear or nonlinear)
Seasonal (additive or multiplicative)
Cyclic
Calendar Variation
6/3/2008
18
6/3/2008
19
Measuring Accuracy
We need a way to compare different time series
techniques for a given data set.
Four common techniques are the:
$
Yi Y
i
n
Yi Yi
MAD =
i =1
=1
100
mean absolute percent error, MAPE =
n i =1
Yi
2
$
Yi Yi )
(
MSE =
n
i =1
n
RMSE =
MSE
20
Extrapolation Models
Extrapolation models try to account for the past
behavior of a time series variable in an effort to
predict
di t th
the ffuture
t
behavior
b h i off th
the variable.
i bl
$ = f (Y , Y , Y ,K)
Y
t +1
t
t 1
t 2
Well
ll first
f
talk
lk about
b
severall extrapolation
l
techniques that are appropriate for stationary data.
6/3/2008
21
An Example
Hasil produksi padi Indonesia dari tahun 1970
sampai tahun 2008 sampai bulan Mei.
Hasil produksi ini berdasarkan musiman
Ada 39 tahun
6/3/2008
22
tahun
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
6/3/2008
produksi padi
18 693 649
18.693.649
20.483.687
19.393.933
21.490.578
22.476.073
22.339.455
23.300.939
23.347.132
25.771.570
26.282.663
29.651.905
32 774 176
32.774.176
33.583.677
35.303.106
38.136.446
39 032 945
39.032.945
39.726.761
40.078.195
41.676.170
44.725.582
tahun
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
produksi padi
45 178 751
45.178.751
44.688.247
48.240.009
48.181.087
46.641.524
49.744.140
51.101.506
49.377.054
49.236.692
50.866.387
51.898.852
50 460 782
50.460.782
51.489.694
52.137.604
54.088.468
54 151 097
54.151.097
54.454.937
57.051.679
58.268.796
23
6/3/2008
24
Moving Averages
Y
+
Y
+
Y
t
t-1
t- k +1
$
Yt +11 =
k
No general method exists for determining k.
We must try out several k values to see what works
best.
6/3/2008
25
6/3/2008
26
6/3/2008
27
Forecasting With
The Moving Average Model
Forecasts for time periods 25 and 26 at time period 24:
Y24 + Y23 36 + 35
$
Y25 =
=
= 355
.
2
2
$ +Y
Y
35 5 + 36
35.5
25
24
$
Y26 =
=
= 35.75
2
2
6/3/2008
28
=1
29
6/3/2008
30
Exponential Smoothing
$ =Y
$ + (Y Y
$ )
Y
t +1
t
t
t
where 0 1
It can be shown that the above equation is equivalent to:
$ = Y + (1 ) Y + (1 ) 2 Y +L+ (1 ) n Y +L
Y
t +1
t
t 1
t 2
t n
6/3/2008
31
Examples of Two
Exponential Smoothing Functions
42
40
Un
nits Sold
38
36
34
32
Number of VCRs Sold
Exp. Smoothing alpha=0.1
30
28
1
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Time Period
6/3/2008
32
6/3/2008
33
Note that,
6/3/2008
34
6/3/2008
35
Seasonality
Seasonality is a regular, repeating pattern
in time series data.
May
y be additive or multiplicative
p
in
nature...
6/3/2008
36
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
18
19
20
21
22
23
24
25
Tim e Pe r iod
10
11
12
13
14
15
16
17
T im e Pe r io d
6/3/2008
37
Y
t + n = E t + St + n p
38
6/3/2008
39
Y
24+ n = E 24 + S24+ n 4
= E + S = 354.44 + 8.45 = 363.00
Y
25
24
21
= E + S = 354.44 17.82 = 336.73
Y
26
24
22
40
Y
t + n = E t St + n p
41
Y
24+ n = E 24 S 24+ n 4
= E S = 353.95 1.015 = 359.13
Y
25
24
21
= E S = 354.44 0.946 = 334.94
Y
26
24
22
= E S = 354.44 1.133 = 400.99
Y
27
24
23
= E S = 354.44 0.912 = 322.95
Y
28
24
24
6/3/2008
42
Trend Models
Trend is the long-term sweep or general
direction of movement in a time series.
Well now consider some nonstationary time
series techniques that are appropriate for
data exhibiting upward or downward trends.
6/3/2008
43
An Example
p
WaterCraft Inc. is a manufacturer of personal
water crafts (also known as jet skis)
skis).
The company has enjoyed a fairly steady
growth in sales of its products
products.
The officers of the company are preparing sales
and
a
d manufacturing
a u actu g p
plans
a s for
o tthe
e co
coming
g yea
year.
Forecasts are needed of the level of sales that
the company
p y expects
p
to achieve each q
quarter.
See file
6/3/2008
44
Double Moving
g Average
g
Y
t + n = E t + nTt
where
E t = 2M t D t
Tt = 2(M t D t ) /(k 1)
M t = (Yt + Yt 1 + L + Yt k +1) / k
D t = (Mt + Mt 1 + L + Mt k +1) / k
45
Y
20+ n = E 20 + nT20
= E + 1T = 2385.33 + 1139.9 = 2525.23
Y
21
20
20
= E + 2T = 2385.33 + 2 139.9 = 2665.13
Y
22
20
20
= E + 3T = 2385.33 + 3 139.9 = 2805.03
Y
23
20
20
= E + 4T = 2385.33 + 4 139.9 = 2944.94
Y
24
20
20
6/3/2008
46
Y
Tt
t + n = E t + nT
where
Et = Yt + (1-)(Et-1+ Tt-1)
Tt = (Et Et-1) + (1-) Tt-1
0 1 and 0 1
47
Forecasting
g With Holts Model
Forecasts for time periods 21 to 24 at time period 20:
Y
20+ n = E 20 + nT20
20
20
6/3/2008
48
E t = Yt St p + (1- )(Et 1 + Tt 1 )
Tt = (E t E t 1 ) + (1 - )Tt 1
St = (Yt E t ) + (1- )St p
0 1
0 1
0 1
6/3/2008
49
6/3/2008
50
E t = Yt / St p + (1- )(Et 1 + Tt 1 )
Tt = (E t E t 1 ) + ((1 - ))Tt 1
St = (Yt / E t ) + (1- )St p
0 1
0 1
0 1
6/3/2008
51
52
Y$ t = b0 + b1X1t
where X1t = t
For example:
X11 = 1, X12 = 2, X13 = 3, K
6/3/2008
53
Forecasting With
Th Li
The
Linear T
Trend
dM
Model
d l
Forecasts for time periods 21 to 24 at time period 20:
$ = b + b X = 3751
Y
. + 92.6255 21 = 2320.3
21
0
1
121
$ = b + b X = 3751
Y
. + 92.6255 22 = 2412.9
22
0
1
122
$ = b + b X = 3751
Y
. + 92.6255 23 = 2505.6
23
0
1
123
$ = b + b X = 3751
Y
. + 92.6255 24 = 2598.2
24
0
1
124
6/3/2008
54
55
$ = b +b X +b X
Y
t
0
1 1t
2 2t
where X1t = t and X 2t = t 2
6/3/2008
56
Forecasting With
The Quadratic Trend Model
Forecasts for time periods 21 to 24 at time period 20:
2
= b +b X +b X
Y
21
0
1 12 1
2 2 2 1 = 653 .67 + 16 .671 21 + 3.617 21 = 2598 .9
2
= b +b X +b X
Y
=
653
.
67
+
16
.
671
22
+
3
.
617
22
= 2771 .1
22
0
1 12 2
2 22 2
2
= b +b X +b X
Y
=
653
.
67
+
16
.
671
23
+
3
.
617
23
= 2950 .4
23
0
1 12 3
2 22 3
2
= b +b X +b X
Y
=
653
.
67
+
16
.
671
24
+
3
.
617
24
= 3137 .1
24
0
1 12 4
2 22 4
6/3/2008
57
Computing Multiplicative
Seasonal Indices
We can compute multiplicative seasonal
adjustment indices for period p as follows:
Yi
i Y$
i
, for all i occuring
Sp =
g in season p
np
The final forecast for period i is then
$ adjusted = Y
$ S , for any i occuring in season p
Y
i
i
p
6/3/2008
58
6/3/2008
59
60
Refining
e
g tthe
e Seaso
Seasonal
a Indices
d ces
Note that Solver can be used to simultaneously
determine the optimal values of the seasonal
indices and the parameters of the trend model
being used.
There is no guarantee that this will produce a
better forecast,, but it should produce
p
a model
that fits the data better in terms of the MSE.
See file Fig11-39.xls
6/3/2008
61
62
6/3/2008
63
6/3/2008
64
StatTools
StatTools is an add-in
add in that simplifies the
process of performing time series analysis
in Excel.
A trial version of StatTools is available on
p y g this book.
the CD-ROM accompanying
For more information on StatTools see:
http://www.palisade.com
6/3/2008
65
Combining Forecasts
It is also possible to combine forecasts to create a
composite forecast.
Suppose we used three different forecasting methods
on a given data set.
Denote the predicted value of time period t using
each method as follows:
$ = b +b F +b F +b F
Y
t
0
1 1t
2 2t
3 3t
6/3/2008
66
6/3/2008
67
P
0,001
0,000
0,005
0,001
6/3/2008
68
t = 1, 2, (dummy waktu)
69
Nave Model
Yt +1 = Yt
2. The simplest model for trend data is
Yt +1 = Yt + (Yt Yt 1 ) or
Yt
Yt +1 = Yt
Yt 1
3. The simplest model for seasonal data is
Yt +1 = Y(t +1) s
6/3/2008
70
Average Methods
1. Simple Averages
obtained by finding the mean for all the relevant values and
then using
g this mean to forecast the next period.
p
n
Yt
Yt +1 =
t =1 n
forstationarydata
2. Moving Averages
obtained by finding the mean for a specified set of values
and then using this mean to forecast the next period
period.
(Y + Yt 1 + K + Yt n +1 )
M t = Yt +1 = t
n
6/3/2008
forstationarydata
71
Average Methods
(continued)
(Y + Yt 1 + K + Yt n +1 )
M t = Yt +1 = t
n
( M t + M t 1 + K + M t n +1 )
(ii) M t =
(ii).
n
(i).
(iii). at = 2M t M t
(iv). bt =
2
( M t M t )
n 1
Yt + p = at + bt p
6/3/2008
f
foralineartrenddata
li
t dd t
72
Yt +1 = Yt + (1 )Yt
9 Exponential Smoothing Adjusted for Trend : Holts Method
1. The exponentially smoothed series :
At = Yt + (1) (At-1+ Tt-1)
2. The trend estimate :
Tt = (At At-1) + (1 ) Tt-1
3. Forecast p periods into the future :
Yt + p = At + pTt
6/3/2008
73
Three
p
parameters
models
Y
St = t + (1 ) St 1
At
4. Forecast p periods into the future :
Yt + p = ( At pTt ) St L + p
6/3/2008
74