View
250
Download
4
Embed Size (px)
Citation preview
Quan_ARMA 1
• 時間序列是指按時間有順序排列的一串資料,如每月物價,每年產值,等
• 影響時間序列變化有四個成因:1. Trend :長期向上或向下的移動趨勢2. Seasonal variation :以年為基礎的變動原型3. Cycle :在 2 到 10年中向上或向下的改變4. Irregular flutuation :無固定規律性的不規則
震盪
第六章 時間序列模式
Quan_ARMA 2
• ARMA model 又稱為 Box-Jankin model , 1970 年代推出
• 用來配適時間序列中的不規則震盪• 適用於 Stationary series ,可解釋序列中的自相關現象。• Stationary series (平穩序列 )
定義:一時間序列的統計特性與時間 t 無關,皆是固定值,稱為平穩序列
E(Yt) =μ , var(Yt) =σ2, cor(Yt ,Yt+k) =ρk for all t
ARMA 模式
僅與時差 k 有關
Quan_ARMA 3
Stationary series
Nonstationary series
6.1 平穩序列 Stationary series
Quan_ARMA 4
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
此為一 nonstationary 序列
Y(t)
-5
0
5
10
15
20
0 20 40 60 80 100 120
如果手中的時序資料不是 stationary, 必須將它轉為 stationary如何轉換? 利用差分轉換
Quan_ARMA 5
例 6.1
• 一 hotel 每週住房人數資料,共 120 筆
Quan_ARMA 6
例 6.1 nonstationary series
First difference
Second difference
Quan_ARMA 7
1. 圖形觀察:原資料圖、差方資料圖2. 觀察自相關係數函數圖 (ACF 圖 )
3. 檢定法:
如何檢測 stationarity ( 平穩性 ) ?
Dickey-Fuller test
Phillips-Perron test
Random-walk with drift test
Quan_ARMA 8
1. Backward 運算: B(Yt) = Yt-1, B2(Yt) = Yt-2
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(
Quan_ARMA 9
差分功能
一階差分消去直線 trend
二階差方消去二次 trend
4 ttt YYY
12 ttt YYY
消除季節因素
四季節差分
月季節差分
Quan_ARMA 10
6.2 自相關係數函數 (ACF)
• autocorrelation at lag k : cor(Yt ,Yt+k) =ρk • k 階自相關係數:
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
Quan_ARMA 11
In general, 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.
3. 檢定 ρj = 0, for all j
以 ACF 判斷平穩性
Quan_ARMA 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 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 Exp6.1
Quan_ARMA 13
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 ρj = 0, for all j
檢定 1~6 階自相關係數皆為 0 自相關係數
Quan_ARMA 14
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 Exp6.1一次差分後
Quan_ARMA 15
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
Quan_ARMA 16
• 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)(1
nrkks
•ACF 及 PACF 是辨識 Box-Jenkins 模式的重要工具
Quan_ARMA 17
6.3 ARMA model
•ARMA model 由二部份組成: AR 及 MA•AR : autoregression 自迴歸,是依變數的自行迴歸,如
•MA : moving average 移動平均,是誤差項的加權和,如
•二者都是將前段時間的資訊納入迴歸模式中,來對目前的觀察現象作解釋Let εt be white noise process, Zt be a stationary series.
white noise : 純雜訊 εt ~ NID( 0, σ2)
Quan_ARMA 18
AR(p), Autoregressive model with order p is defined as
tptptt ZZZ ...11
...11 qtqtttZ
MA(p), Movingaverage model with order q is defined as
ARMA(p,q), Autoregressive and movingaverage with order (p,q) is defined as
...... 1111 qtqttptptt ZZZ
註: δ 是一 constant , 並不一定是 μ
Quan_ARMA 19
註:1 、 AR(p) model 可以下列式表示 (assume δ=0) :
(B) or Z ,)...1( tt1 tq
qt BBZ
ity)(stationar 0)(
(B) or Z (B)Zor )...1( 1tt1
滿足平穩性之根需在單位圓外,始
B
ZBB ttttp
p
)()(
t Zor, )()( BB
tt BZB
2 、 MA(q) model 可以下列式表示:
3 、 ARMA(p,q) model 可以下列式表示:
)(B
)(B
是 B 的 p 次多項式,
是 B 的 q 次多項式,
lity)(invertibi 0)( 滿足可逆性之根需在單位圓外,始 B
Quan_ARMA 20
MA(q) model
),0(~ )(... 2t11 NBZ tqtqttt
qkk
q
q
for ,0)...1(
.............)...1(
...
221
221
12111
Zt 之變異數及自相關係數:222
12 )...1( qZ
Movingaverage with order q:
由此得到參數估計量
註: For MA(q) model , μ=δ
Quan_ARMA 21
Zt 偏自相關係數 (partial autocorrelation):
.............
21
212
122
111
For MA model , ACF cuts off after lag q, PACF dies down.
Quan_ARMA 22
MA(1) model
2for ,0)1(
:ACF
k
21
11
k
0 112
11
1|| ,)1( 1111 tttt BZ
}1/{}1{
:)1(2
12
11 kk
kk
PACF
由此得到估計量
theta 0.9 0.7 0.5 0.3 0.1 -0.1 -0.3 -0.5 -0.7 -0.9
Rho_1 -0.50 -0.47 -0.40 -0.28 -0.10 0.10 0.28 0.40 0.47 0.50
phi_11
-0.50 -0.47 -0.40 -0.28 -0.10 0.10 0.28 0.40 0.47 0.50
phi_22
0.33 0.28 0.19 0.08 0.01 0.01 0.08 0.19 0.28 0.33
phi_33
-0.24 -0.19 -0.09 -0.02 0.00 0.00 0.02 0.09 0.19 0.24
phi_44
0.19 0.13 0.05 0.01 0.00 0.00 0.01 0.05 0.13 0.19
Quan_ARMA 23
Quan_ARMA 24
, 2211 ttttZ MA(2) model
3for ,0)1(
)1(
:
k
22
21
22
22
21
2111
k
ACF
由此得到參數估計
量
Quan_ARMA 25
Quan_ARMA 26
AR(p) model
, ....., kkppkk 21for , ...11
Autoregressive with order p
tt
tptptt
B
ZZZ
)( Z Z(B) ,0
,...1
tt
11
此模式滿足平穩性的條件:係數使得方程式 的根在單位圓外
2221
2 )...1( qZ
Variance for AR(p) model
Autocorrelation for AR(p) model
0)( B
Quan_ARMA 27
Partial Autocorrelation for AR(p) model
...
..........
, ...
, ...
112211
2132112
1231211
ppppp
pp
pp
稱為 Yule-Walker 等
式 , 由此得到估計量
1for ,0 .......
,
22
212
1
22
111
p kkk
For AR model , ACF dies down, PACF cuts off after lag p.
Quan_ARMA 28
1||
B)Z-(1or , :)1(
1
t111
tttt ZZAR
Stationarity 之條件
ACF 呈指數下降,或波動下降; PACF 在 k=2 處切斷
2for 0 , :
, :
111
1k11
kPACF
ACF
kk
k
11̂ 估計量:
註: AR(1) 過程又稱為馬可夫過程 (Markov process)
........ ,0 ,8.0
,)8.0( ,8.0
2211
1
k
k
例: Zt = 6 - 0.8 Zt-1 + εt
Quan_ARMA 29
Quan_ARMA 30
之根在單位圓外 (B)
B-B-1 (B) , :)2( 2212211
tttt ZZZAR
Stationarity 之條件
Yule-Walker 等式 :2112
1211
2
21
2
1
1
22
1
1
3for ,0 , , 222111 k φkk
例: Zt = Zt-1 - 0.6Zt-2 + εt
...... ,35.0 ,025.0
0 ,66.0 ,625.0
32
22111
kk
Quan_ARMA 31
Quan_ARMA 32
Quan_ARMA 33
ARMA(p,q) model
,...... 1111 ptptqtqttt ZZZ
若 q<= p ,則 ACF 遞減 (damped exponentially or sine-wave) 若 q > p ,前面 q-p+1 個 p 和其它的 p 呈二段式遞減
Quan_ARMA 34
1|| 1,|| ,
:)1,1(
111111 tttt ZZ
ARMA
2k ,
,
11
2-1
))(1(1
1
112
1
1111
kk
ACF 與 PACF 皆漸漸消失型 (damped exponentially or sine-wave)
1
Quan_ARMA 35
Quan_ARMA 36
Model acf Pacf
MA(q) 時差 q 之後切斷 指數或正弦函數式漸漸消失
AR(p) 指數或正弦函數式漸漸消失 時差 p 之後切斷
ARMA(p,q) 指數或正弦函數式漸漸消失 指數或正弦函數式漸漸消失
ARMA model 中 acf 與 pacf 的表象
以上列出的 acf 與 pacf 的特性將作為辨識適合的 ARMA模式的準則。
Quan_ARMA 37
6.4 ARMA 建模的步驟
1) Stationize: 檢測序列的平穩性,對不平穩的序列,差分轉換為平穩序列。
2) Tentative identification: 由資料的 acf, pacf 辨識適合的 ARMA模式 , 選出數個可能模式。
3) Estimation: 對遴選模式估計參數4) Diagnostic Checking: 由各種診斷法來檢視模式的適合性,挑選出一模式,視為用於預測的模式
5) Forecasting: 以最終模式預測未來值6) 應隨時做模式的更新。
Quan_ARMA 38
(1) 平穩化過程
• 如果手中的時序資料不是 stationary,以一次差分轉換, 使成為一 stationary series,必要時用多次差分。
• 利用檢定確認它是一平穩序列
Quan_ARMA 39
(2) 初步辨識• 由樣本的 acf 及 pacf 的走勢及變化來辨識 ARMA 模式中
的 p , q 值• 選出數個候選模式• 模式應力求簡單
Model acf Pacf
MA(q) 時差 q 之後切斷 指數或正弦函數式漸漸消失
AR(p) 指數或正弦函數式漸漸消失 時差 p 之後切斷
ARMA(p,q) 指數或正弦函數式漸漸消失 指數或正弦函數式漸漸消失
Quan_ARMA 40
(3) 參數估計• 原則上用 least square estimate• 估計的係數必滿足 平穩性及可逆性之條件• ARMA 係數的估計有時需以遞迴的數值法得
解,有可能遇到不收歛情況
Quan_ARMA 41
例 : 一平穩序列,依據下列現象分別以 AR(1), MA(1), 及 ARMA(1,1) 配適:
Autocorrelations
Lag Correlation 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 -
0 1.00000 | |********************| 0
1 -.43773 | |*********| . | 0.100000
2 0.05214 | . |* . | 0.117610
3 -.00119 | . | . | 0.117841
4 -.07136 | . *| . | 0.117841
5 -.00389 | . | . | 0.118273
6 -.09027 | . **| . | 0.118274
7 0.08643 | . |** . | 0.118961
8 -.04553 | . *| . | 0.119587
9 0.08755 | . |** . | 0.119760
10 -.13564 | . ***| . | 0.120399
11 0.18628 | . |****. | 0.121917
12 -.24375 | *****| . | 0.124731
ACF PACF
Partial Autocorrelations
Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1
1 -0.43773 | *********| . |
2 -0.17253 | .***| . |
3 -0.06368 | . *| . |
4 -0.11413 | . **| . |
5 -0.11104 | . **| . |
6 -0.19625 | ****| . |
7 -0.07274 | . *| . |
8 -0.08091 | . **| . |
9 0.02756 | . |* . |
10 -0.14766 | .***| . |
11 0.07253 | . |* . |
12 -0.20707 | ****| .
Quan_ARMA 42
以 AR(1) 配適:
Conditional Least Squares Estimation
Parameter Estimate Standard Error
t Value ApproxPr > |t|
Lag
AR1,1 -0.44383 0.09084 -4.89 <.0001 1
Variance Estimate 1.185361
Std Error Estimate 1.088743
AIC 301.7874
SBC 304.3926
Number of Residuals
100
Model for variable ZtNo mean term in this model.
Autoregressive Factors
Factor 1: 1 + 0.44383 B**(1)
Quan_ARMA 43
以 MA(1) 配適:
Conditional Least Squares Estimation
Parameter
Estimate
Standard Error
t Value
ApproxPr > |t|
Lag
MA1,1 0.64635 0.07778 8.31 <.0001 1
Variance Estimate 1.11113
Std Error Estimate 1.054101
AIC 295.3204
SBC 297.9256
Number of Residuals
100
Model for variable ZtNo mean term in this model.
Moving Average Factors
Factor 1: 1 - 0.64635 B**(1)
Quan_ARMA 44
以 ARMA(1,1) 配適:
Model for variable ZtNo mean term in this model.
Autoregressive Factors
Factor 1: 1 - 0.37117 B**(1)
Moving Average Factors
Factor 1: 1 - 1 B**(1)
Conditional Least Squares Estimation
Parameter Estimate Standard Error t Value ApproxPr > |t|
Lag
MA1,1 1.00000 0.01565 63.89 <.0001 1
AR1,1 0.37117 0.09579 3.87 0.0002 1
Variance Estimate 1.01438
Std Error Estimate 1.007164
AIC 287.1952
SBC 292.4055
Number of Residuals 100
Quan_ARMA 45
(3) 模式診斷• 一個適合的模式需滿足:殘差為 white
noise 、及係數顯著• 若殘差不為 white noise ,表示仍有自相關
現象存在於殘差內,所選的階數不夠• 若係數不顯著,表示自變數之間有相關性,
參數個數太多,所選的階數超過
Quan_ARMA 46
殘差為 white noise 之檢測: 1 、 autocorrelation check for residual (chi-square test)
H0 : ρ1= ρ2= …=ρk=0 ( 在 SAS 中每六個檢定一次 )
p-value < 0.05 ,結論為其中至少有一個不為 0
2 、依據殘差的 ACF, PACF ,考慮要增加的項目
係數的檢測: 1 、顯著性 t-test
p-value < 0.05 ,結論為係數不為 0 ,考慮刪去 p-value > 0.05 的 2 、共線性狀況 檢查係數的相關係數
Quan_ARMA 47
AIC, SBC 模式判定值
AICk = n ln(SSEk) – n ln(n) + 2k
SBCk = n ln(SSEk) – n ln(n) + ln(n) k
此處 SSE 為誤差平方值, k 為估計參數個數 ,判定值愈小,模式愈佳。
預測式的選取
當我們得到了數個適合的模式,比較 AIC 、 SBC 、標準誤、以及相關的適合現象,最後選一最理想的做為預測式。原則上,預測式愈簡單愈好。
Quan_ARMA 48
例題: 一、以 AR(1) 配適:
Autocorrelation Check of Residuals
To Lag
Chi-Square
DF Pr > ChiSq
Autocorrelations
6 6.43 5 0.2663 -0.076 -0.163 -0.020 -0.105 -0.096 -0.088
12 10.35 11 0.4991 0.060 0.023 0.029 -0.062 0.062 -0.147
18 17.83 17 0.3997 0.093 -0.067 0.064 0.077 -0.141 0.135
24 24.79 23 0.3613 0.101 -0.105 -0.164 0.075 -0.015 0.017
另由殘差的 ACF PACF 顯示 無自相關
二、以 MA(1) 配適:
Autocorrelation Check of Residuals
To Lag
Chi-Square
DF Pr > ChiSq
Autocorrelations
6 8.15 5 0.1484 0.067 0.061 -0.051 -0.151 -0.141 -0.151
12 13.10 11 0.2870 0.003 -0.039 0.018 -0.107 0.043 -0.167
18 19.11 17 0.3225 0.093 -0.053 0.081 0.097 -0.074 0.129
24 24.51 23 0.3761 0.035 -0.078 -0.169 0.022 -0.073 0.004
另由殘差的 ACF PACF 顯示 無自相關
Quan_ARMA 49
三、以 ARMA(1,1) 配適:
Autocorrelation Check of Residuals
To Lag
Chi-Square
DF Pr > ChiSq
Autocorrelations
6 4.61 4 0.3297 -0.079 0.158 0.057 -0.037 -0.021 -0.088
12 12.81 10 0.2343 0.051 -0.044 0.042 -0.127 0.090 -0.203
18 21.03 16 0.1773 0.126 -0.099 0.062 0.090 -0.124 0.123
24 26.35 22 0.2371 0.006 -0.055 -0.158 0.059 -0.093 0.027
Correlations of ParameterEstimates
Parameter MA1,1 AR1,1
MA1,1 1.000 0.117
AR1,1 0.117 1.000
共線性現象微弱
另由殘差的 ACF PACF 顯示 無自相關
Quan_ARMA 50
參數顯著性Is residual white noise?
Std Error
AIC, SBC
Model_1
AR(1) 顯著 Yes 1.089 302, 304
Model_2
MA(1) 顯著 Yes 1.054 295, 298
Model_3
ARMA(1,1)
顯著,但有一估計值為 1 ,不滿足可逆性
Yes 1.007 287, 292
在此三模式中, MA(1) 最適合資料,選定預測式為 Yt = εt – 0.646 εt-1 , S = 1.054
三模式比較
Quan_ARMA 51
Step 1、平穩性檢測Step 2、遴選模式及診斷Step 3、預測
y
0
20
40
60
80
100
1 9 17 25 33 41 49 57 65 73 81 89 97 105 113 121 129 137 145 153 161
原始資料序列
6.5 Case Study DVD weekly sale series
Quan_ARMA 52
Step 1.1 、平穩性檢測Autocorrelations
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 234.852 1.00000 | |********************| 0
1 228.692 0.97377 | . |******************* | 0.07
2 219.550 0.93485 | . |******************* | 0.13
3 211.028 0.89856 | . |****************** | 0.16
4 202.545 0.86244 | . |***************** | 0.19
5 193.677 0.82468 | . |**************** | 0.21
6 186.454 0.79392 | . |**************** | 0.23
7 182.484 0.77702 | . |**************** | 0.25
8 179.699 0.76516 | . |*************** | 0.26
9 176.953 0.75347 | . |*************** | 0.28
10 174.970 0.74502 | . |*************** | 0.29
Dickey-Fuller Unit Root Tests
Type Lags Rho Pr < Rho Tau Pr < Tau F Pr > F
Zero Mean 0 0.4544 0.7937 0.78 0.8800
Single Mean 0 -1.9634 0.7812 -0.84 0.8051 0.87 0.8489
Trend 0 -8.9177 0.5030 -2.18 0.4962 2.49 0.6796
原始資料非平穩序列
Quan_ARMA 53
Step 1.2 、差分一次,平穩性檢測
Autocorrelations
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 7.916369 1.00000 | |********************| 0
1 3.442783 0.43489 | . |********* | 0.079057
2 -0.065133 -.00823 | . | . | 0.092813
3 0.015437 0.00195 | . | . | 0.092817
4 -0.136313 -.01722 | . | . | 0.092817
5 -1.889516 -.23868 | *****| . | 0.092837
6 -2.656235 -.33554 | *******| . | 0.096597
7 -0.890803 -.11253 | . **| . | 0.103625
8 -0.523478 -.06613 | . *| . | 0.104386
Dickey-Fuller Unit Root Tests
Type Lags Rho Pr < Rho Tau Pr < Tau F Pr > F
Zero Mean 0 -88.5965 <.0001 -7.76 <.0001
Single Mean 0 -89.1810 0.0012 -7.78 <.0001 30.26 0.0010
Trend 0 -89.2742 0.0005 -7.76 <.0001 30.13 0.0010
一次差分資料為平穩序列
Quan_ARMA 54
Step 2 、遴選模式及診斷 (設定平均數為 0) 觀察 ACF, PACF ; r1>0 r6>0 acf dies down r11>0 r22>0 pacf dies down
儲選模式一: AR(1) or ARMA(1,1)
Partial Autocorrelations
Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1
1 0.43489 | . |********* |
2 -0.24339 | *****| . |
3 0.14715 | . |*** |
4 -0.11389 | .**| . |
5 -0.23959 | *****| . |
6 -0.14628 | ***| . |
7 0.08505 | . |**. |
8 -0.15793 | ***| . |
9 0.03565 | . |* . |
10 -0.05646 | . *| . |
11 0.01943 | . | . |
12 0.06090 | . |* . |
PACF
Quan_ARMA 55
Step 2.1 、模式 1 AR(1)
AR(1) 配適結果,殘差仍有自相關現象
Autocorrelation Check of Residuals
To Lag
Chi-Square
DF
Pr > ChiSq
Autocorrelations
6 32.93 5 <.0001 0.104
-0.244
0.029
0.107
-0.165
-0.297
12 37.32 11
0.0001 0.058
0.007
-0.073
-0.028
0.069
0.105
18 40.89 17
0.0010 0.063
0.028
0.031
-0.113
-0.037
0.007
24 48.93 23
0.0013 0.040
-0.092
-0.054
0.144
0.028
-0.091
30 53.69 29
0.0035 0.100
0.116
-0.030
-0.017
-0.006
0.003
Autoregressive Factors
Factor 1: 1 - 0.44279 B**(1)
Conditional Least Squares Estimation
Parameter
Estimate
Standard Error
t Value
ApproxPr > |t|
Lag
AR1,1 0.44279
0.07159 6.19 <.0001
1
Quan_ARMA 56
Step 2.2 、模式 2 ARMA(1,1)
ARMA(1,1) 配適結果,殘差仍有自相關現象,在 k=6
Autoregressive Factors
Factor 1: 1 - 0.01541 B**(1)
Moving Average Factors
Factor 1: 1 + 0.57105 B**(1)
Autocorrelation Check of Residuals
To Lag
Chi-Square
DF
Pr > ChiSq
Autocorrelations
6 18.23 4 0.0011 0.000
-0.006
-0.009
0.045
-0.131
-0.299
12 22.07 10
0.0148 0.054
-0.075
-0.034
-0.032
0.072
0.080
18 27.56 16
0.0356 0.084
0.000
0.061
-0.132
0.002
-0.049
24 32.62 22
0.0675 0.039
-0.081
-0.043
0.112
0.031
-0.059
30 36.71 28
0.1253 0.092
0.093
-0.034
0.015
-0.049
0.015
Autocorrelation Plot of Residuals
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 6.008539 1.00000 | |********************| 0
1 0.00067648 0.00011 | . | . | 0.079057
2 -0.038079 -.00634 | . | . | 0.079057
3 -0.056140 -.00934 | . | . | 0.079060
4 0.269243 0.04481 | . |* . | 0.079067
5 -0.785409 -.13072 | ***| . | 0.079226
6 -1.794893 -.29872 | ******| . | 0.080562
7 0.324296 0.05397 | . |* . | 0.087211
Quan_ARMA 57
Step 2.3 、模式 3 AR with B,B^6, MA with B
配適結果,殘差無自相關現象, AR1,1 係數不顯著
Autoregressive Factors
Factor 1:
1 + 0.02809 B**(1) + 0.32725 B**(6)
Moving Average Factors
Factor 1: 1 + 0.569 B**(1)
Autocorrelation Check of Residuals
To Lag Chi-Square
DF Pr > ChiSq
Autocorrelations
6 3.38 3 0.3367 0.015 -0.015 -0.025 0.036 -0.134 -0.001
12 7.10 9 0.6270 0.079 -0.085 -0.030 -0.075 0.038 -0.013
18 14.65 15 0.4772 0.134 -0.054 0.041 -0.128 0.028 -0.051
24 20.06 21 0.5176 0.108 -0.052 -0.037 0.083 0.021 -0.077
30 24.78 27 0.5869 0.084 0.087 -0.075 0.018 -0.059 -0.016
Correlations of Parameter Estimates
Parameter
MA1,1 AR1,1 AR1,2
MA1,1 1.000 0.752 -0.139
AR1,1 0.752 1.000 -0.010
AR1,2 -0.139 -0.010 1.000
Conditional Least Squares Estimation
Parameter
Estimate
Standard Error
t Value
ApproxPr > |t|
Lag
MA1,1 -0.56900
0.10222 -5.57 <.0001
1
AR1,1 -0.02809
0.11684 -0.24 0.8103
1
AR1,2 -0.32725
0.08051 -4.06 <.0001
6
Quan_ARMA 58
Step 2.4 、模式 4 AR with B^6, MA with B
Autoregressive Factors
Factor 1:
1 + 0.32052 B**(6)
Moving Average Factors
Factor 1: 1 + 0.55465 B**(1)
Conditional Least Squares Estimation
Parameter
Estimate
Standard Error
t Value
ApproxPr > |t|
Lag
MA1,1 -0.55465
0.06761 -8.20 <.0001
1
AR1,1 -0.32052
0.08004 -4.00 <.0001
6
Correlations of ParameterEstimates
Parameter
MA1,1 AR1,1
MA1,1 1.000 -0.188
AR1,1 -0.188 1.000
Autocorrelation Check of Residuals
To Lag
Chi-Square
DF Pr > ChiSq
Autocorrelations
6 3.10 4 0.5410 0.008
-0.019
-0.013
0.042 -0.127
0.000
12 6.83 10 0.7411 0.093
-0.078
-0.025
-0.066
0.044 -0.006
18 13.93 16 0.6039 0.135
-0.047
0.048 -0.119
0.035 -0.041
24 19.71 22 0.6010 0.116
-0.044
-0.030
0.094 0.028 -0.072
30 24.57 28 0.6510 0.090
0.093 -0.071
0.025 -0.050
-0.008
Quan_ARMA 59
Autoregressive Factors
Factor 1:
1 - 0.43226 B**(1)Moving Average Factors
Factor 1: 1 - 0.28716 B**(6)
Step 2.5 、模式 5 AR with B, MA with B^6
Conditional Least Squares Estimation
Parameter
Estimate
Standard Error
t Value
ApproxPr > |t|
Lag
MA1,1 0.28716 0.07961 3.61 0.0004 6
AR1,1 0.43226 0.07289 5.93 <.0001 1
Correlations of ParameterEstimates
Parameter MA1,1 AR1,1
MA1,1 1.000 -0.118
AR1,1 -0.118 1.000
Autocorrelation Check of Residuals
To Lag Chi-Square
DF Pr > ChiSq
Autocorrelations
6 15.30 4 0.0041 0.107 -0.247 0.013 0.032 -0.135 -0.029
12 21.41 10 0.0184 0.110 -0.053 -0.073 -0.051 0.029 0.108
18 25.61 16 0.0598 0.117 -0.007 -0.004 -0.094 -0.031 0.005
24 32.99 22 0.0620 0.101 -0.058 -0.067 0.111 0.018 -0.094
30 38.56 28 0.0883 0.111 0.112 -0.053 -0.010 -0.017 -0.029
Quan_ARMA 60
Step 2.6 、模式 6 MA(2) with B & B^6
Moving Average Factors
Factor 1: 1 + 0.61177 B**(1) - 0.32354 B**(6)
Correlations of ParameterEstimates
Parameter
MA1,1 MA1,2
MA1,1 1.000 0.682
MA1,2 0.682 1.000
Conditional Least Squares Estimation
Parameter
Estimate
Standard Error
t Value
ApproxPr > |t|
Lag
MA1,1 -0.61177
0.05499 -11.13 <.0001 1
MA1,2 0.32354 0.05476 5.91 <.0001 6Autocorrelation Check of Residuals
To Lag Chi-Square
DF Pr > ChiSq
Autocorrelations
6 2.24 4 0.6912 0.011 -0.004 -0.001 0.015 -0.107 -0.039
12 5.87 10 0.8263 -0.069 0.006 -0.058 -0.044 0.051 0.091
18 9.52 16 0.8905 0.067 0.034 0.004 -0.107 0.033 -0.045
24 14.69 22 0.8751 0.057 -0.026 -0.070 0.108 0.046 -0.070
30 20.07 28 0.8618 0.115 0.081 -0.053 0.033 -0.063 -0.011
Quan_ARMA 61
參數Is residual white noise?
Std Error AIC, SBC
Model_1
AR(1) 顯著 No 2.54 753.6, 756.7
Model_2
ARMA(1,1)
顯著 No 2.45 743.9, 753.2
Model_3
AR: B, B^6 MA: B
AR_B 不顯著 Yes 2.336 729.5, 741.8
Model_4
AR: B^6 MA: B
顯著 Yes 2.330 726.7, 732.8
Model_5
AR: BMA: B^6
顯著 yes 2.440 741.4, 747.6
Model_6
MA: B,B^6
顯著 yes 2.278 719.7, 725.9選擇 Model 6 為預測式
Step 2.7 、 Summary
Quan_ARMA 62
Step 3 預測式
ttttt
tt
ZZ
BBZB
611
6
324.0612.0
or ,)324.0612.01()1(
Sample mean = 59.3
Quan_ARMA 63
Forecasts for variable y
Obs Forecast
Std Error
95% Confidence Limits
162 83.1502 2.2797 78.6820 87.6184
163 84.6215 4.3242 76.1463 93.0967
164 84.1300 5.6745 73.0083 95.2517
165 82.7623 6.7602 69.5125 96.0121
166 81.8336 7.6943 66.7531 96.9141
167 81.0599 8.5266 64.3481 97.7718
168 81.0599 9.0182 63.3846 98.7353
169 81.0599 9.4843 62.4710 99.6489
170 81.0599 9.9286 61.6002 100.5197
171 81.0599 10.3539 60.7667 101.3532
預測 – 未來 10星期的預測區間
Quan_ARMA 64