1 chap 9 box-jenkins models box-jenkins 模式用於描述 stationary 序列 stationary series (...
Post on 19-Dec-2015
266 views
TRANSCRIPT
1
Chap 9 Box-Jenkins Models
• Box-Jenkins 模式用於描述 stationary 序列• Stationary series (平穩序列 )
定義: The statistical properties of the time series are constant
through times.
E(Yt) =μ , var(Yt) =σ2 , cor(Yt ,Yt+k) =ρk for all t
• 如果手中的時序資料不是 stationary, 必須將它轉為stationary
• 如何轉換?
2
Stationary series
Nonstationary series
3
Exp 9.1 The company would like to develop a prediction model that can be used to give prediction interval forecasts of weekly sales of Asorbent Paper Towels. For the past 120 weeks the company has recorded weekly sales of Absorbent Paper Towels.
t y 1stDiff
1 15
214.406
4
-0.593
6
314.938
30.531
9
416.037
41.099
1
5 15.632
-0.405
4
614.397
5
-1.234
5
713.895
9
-0.501
6
814.076
50.180
6
9 16.3752.298
5
1016.534
20.159
2
First Differences Zt = Yt – Yt-1
The original series is not a stationary series
Y(t)
-5
0
5
10
15
20
0 20 40 60 80 100 120
4
Zt = Y(t) -Y(t-1)
-4
-3
-2
-1
0
1
2
3
4
0 120
First Differences series becomes a stationary series
2ndDiff
-4
-3
-2
-1
0
1
2
3
4
5
0 120
Second Differences series is still a stationary series
5
圖形觀察:原資料圖、差方資料圖檢定法:
如何檢測 stationarity?( 平穩性 )
Dickey-Fuller test
Phillips-Perron test
Random-walk with drift test
6
1. Backward 運算: B(Yt) = Yt-1, B2(Yt) = Yt-1
2. First difference 一階差分 :
3. Second differences 二階差分 :
1 ttt YYY
差分運算
2112 2)( tttttt YYYYYY
ttt YBBYBY )21()1( 222
tttt YBYYY )1( .4 1
5. Difference with lag k : tk
ktt YBYY )1(
7
差分功能
一階差分消去直線 trend
二階差方消去二次 trend
4 ttt YYY
12 ttt YYY
消除季節因素
四季節差分
月季節差分
8
Fig 9.1 nonstationary series
First difference
Second difference
9
9.2 The autocorrelation and partial autocorrelation function
• autocorrelation at lag k : cor(Yt ,Yt+k) =ρk • Sample autocorrelation at lag k, rk
n
t
kn
tktt
k
YY
YYYYr
1
2
1
)(
))((
• ACF : autocorrelation function, 由 rk , k= 0,1,2,….. 組成的函數
• Standard error of rk :
2,3,....k if )(
21
1k if
2/1
2/1
1
2
)(1
2/1
n
rsk
jj
n
rk
10
Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error
0 19.162294 1.00000 | |********************| 0
1 18.445606 0.96260 | . |******************* | 0.091287
2 17.388503 0.90743 | . |****************** | 0.154197
3 16.349929 0.85323 | . |***************** | 0.193651
4 15.343692 0.80072 | . |**************** | 0.222787
5 14.232902 0.74276 | . |*************** | 0.245601
6 13.116331 0.68449 | . |************** | 0.263656
7 12.028851 0.62774 | . |************* | 0.278071
8 11.088860 0.57868 | . |************ | 0.289639
9 10.185709 0.53155 | . |***********. | 0.299119
10 9.493686 0.49544 | . |********** . | 0.306890
11 8.977998 0.46852 | . |********* . | 0.313484
12 8.517382 0.44449 | . |********* . | 0.319266
13 7.970955 0.41597 | . |******** . | 0.324382
14 7.347767 0.38345 | . |******** . | 0.328797
15 6.760440 0.35280 | . |******* . | 0.332503
16 6.188561 0.32296 | . |****** . | 0.335608
17 5.566404 0.29049 | . |****** . | 0.338187
18 4.803283 0.25066 | . |***** . | 0.340260
19 3.882712 0.20262 | . |**** . | 0.341796
20 2.961125 0.15453 | . |*** . | 0.342795
21 2.144619 0.11192 | . |** . | 0.343375
22 1.389010 0.07249 | . |* . | 0.343679
"." marks two standard errors
ACF for Exp9.1
11
Autocorrelation Check for White Noise
To Lag
Chi-Square
DF Pr > ChiSq
Autocorrelations
6 518.57 6 <.0001 0.963 0.907 0.853 0.801 0.743 0.684
12 739.59 12 <.0001 0.628 0.579 0.532 0.495 0.469 0.444
18 836.62 18 <.0001 0.416 0.383 0.353 0.323 0.290 0.251
24 848.87 24 <.0001 0.203 0.155 0.112 0.072 0.033 0.002
Test H0 : ρj = 0, j=1,2, … k
註: White noise (純雜訊 ) 是一獨立常態分佈的序列 εt ~ NID(0, σ2) , then εt is a white noise
12
Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error
0 1.208715 1.00000 | |********************| 0
1 0.370658 0.30665 | . |****** | 0.091670
2 -0.078249 -.06474 | . *| . | 0.099919
3 -0.086619 -.07166 | . *| . | 0.100271
4 0.126391 0.10457 | . |** . | 0.100700
5 0.101691 0.08413 | . |** . | 0.101609
6 0.027608 0.02284 | . | . | 0.102192
7 -0.160292 -.13261 | .***| . | 0.102235
8 -0.143891 -.11904 | . **| . | 0.103671
9 -0.210121 -.17384 | .***| . | 0.104813
10 -0.142910 -.11823 | . **| . | 0.107209
11 -0.062396 -.05162 | . *| . | 0.108299
12 0.025252 0.02089 | . | . | 0.108505
13 0.049984 0.04135 | . |* . | 0.108539
14 0.023417 0.01937 | . | . | 0.108672
15 -0.073248 -.06060 | . *| . | 0.108701
16 -0.0029263 -.00242 | . | . | 0.108984
17 0.154399 0.12774 | . |***. | 0.108985
18 0.259741 0.21489 | . |**** | 0.110236
19 0.067449 0.05580 | . |* . | 0.113701
20 -0.054839 -.04537 | . *| . | 0.113931
21 -0.084327 -.06977 | . *| . | 0.114083
ACF for Exp9.1with 一次差分
13
Autocorrelation Check for White Noise
To Lag Chi-Square DF Pr > ChiSq Autocorrelations
6 14.96 6 0.0206 0.307 -0.065 -0.072 0.105 0.084 0.023
12 25.27 12 0.0136 -0.133 -0.119 -0.174 -0.118 -0.052 0.021
18 34.95 18 0.0096 0.041 0.019 -0.061 -0.002 0.128 0.215
24 37.22 24 0.0416 0.056 -0.045 -0.070 -0.035 -0.052 -0.038
Test H0 : ρj = 0, j=1,2, … k
14
In general, for nonseasonal data
1. If the ACF either cuts off fairly quickly or dies
down fairly quickly, then the time series
shoud be considered stationary.
2. If the ACF dies down extremely slowly, then
the time series should be considered
nonstationary.
以 ACF 判斷平穩性
15
• Sample partial autocorrelation at lag k is
2,3,...k if 1
1k if
1
1,1
1
1,1
1
k
jjk
k
jjkjkk
kk
rr
rrr
r
r
• PACF : partial autocorrelation function, 由 rkk , k= 0,1,2,….. 組成的函數
• Standard error of rkk : 2/1)(1nrkks
•ACF 及 PACF 是辨識 Box-Jenkins 模式的重要工具