• 沒有找到結果。

參考書:  ARIMA 模型全稱為自回歸移動平均模型 Chap13 ARIMA 模式

N/A
N/A
Protected

Academic year: 2021

Share "參考書:  ARIMA 模型全稱為自回歸移動平均模型 Chap13 ARIMA 模式"

Copied!
66
0
0

加載中.... (立即查看全文)

全文

(1)

Chap13 ARIMA模式

ARIMA模型全稱為自回歸移動平均模型

Autoregressive Integrated Moving Average Model

由 Box-Jankin 在1970年代推出

Quan_ARMA 1

建立 ARIMA 模式之目地在對未來進行預測

參考書:

Time Series Analysis:Forecasting & Control , Box, Jenkins, Reinsel

(2)

13.1 平穩序列 Stationary series

Nonstationary series

Stationary

series

(3)

Stationary Series

定義13.1:一時間序列的統計特性與時間 t 無關,皆是 固定值,稱為平穩序列

E(Y t

) =μ,var(Y

t

) =σ

2

,cor(Y

t

,Y

t+k

) =ρ

k

for all t

Quan_ARMA 3

僅與時差 k 有關

一、Y

t

的平均數不隨時間改變 二、 Y

t

的變異數不隨時間改變

三、 不同時間點的資料相關性只與二者相隔時間 長短有關,而不與觀察值之時間點有關

(參考圖13.1 – 13.6)

(4)

如何檢測 stationarity (平穩性) ?

1. 圖形觀察:原始資料圖、差方資料圖 2. 觀察自相關係數函數圖 (ACF 圖)

3. 檢定法:

• Dickey-Fuller test

• Phillips-Perron test

• Random-walk with drift test

(5)

例 13.1 一 hotel 每週住房人數資料,

共 120 筆

Quan_ARMA 5

如果時序資料不是 stationary, 可以將它轉為 stationary

如何轉換? 利用差分轉換

t y 1stDiff

1 15

2 14.4064 -0.5936

3 14.9383 0.5319

4 16.0374 1.0991

5 15.632 -0.4054

6 14.3975 -1.2345

7 13.8959 -0.5016

8 14.0765 0.1806

9 16.375 2.2985

10 16.5342 0.1592

First Differences Zt = Yt – Yt-1

(6)

例 13.1

original data

First

difference

Second

difference

(7)

1. Backward 運算: B(Y

t

) = Y

t-1

,

B

2

(Y

t

) = Y

t-2

2. First difference 一階差分 : 3. Second differences 二階差分 :

 1

Y t Y t Y t

2 1

1

2   (  )   2

Y t Y t Y t Y t Y t Y t

Quan_ARMA 7

差分運算 difference

t t

t B Y B B Y

Y ( 1 ) 2 ( 1 2 2 )

2     

t t

t

t Y Y B Y

Y ( 1 )

.

4    1  

5. Difference with lag k:

t k k

t

t Y B Y

Y  ( 1  )

(8)

差分功能

一階差分消去直線 trend 二階差方消去二次 trend

Y tY tY t 4

 12

Y t Y t Y t

消除季節因素 四季節差分

月季節差分

(9)

13.3.1 自我相關函數 (ACF)

 autocorrelation at lag k : cor(Y

t

,Y

t+k

) =ρ

k

 (樣本) k 階自相關係數:

 

n t k

n

t

k t t

k

Y Y

Y Y

Y Y

r

1

2 1

) (

) )(

(

2,3,....

k if )

( 2 1

1 k if

2 / 1

2 / 1

1 2 ) (

1

2 / 1

 

 

 

 

 

 

n s r

k

j j n

rk

Quan_ARMA 9

ACF : autocorrelation function, 由 r

k

, k= 0,1,2,…..組成的函數

Standard error of r

k

:

(10)

以ACF 判斷平穩性

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.

(11)

Quan_ARMA 11

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

Exp13.1

Rho 值 的臨界點

(12)

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 H

0

: ρ

j

= 0, j=1,2, … k

註:White noise (純雜訊)是一獨立常態分佈的序列

2

檢定 1~6 階自 相關係數不為 0

的顯著性 自相關係數

(13)

Quan_ARMA 13 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 Exp13.1 一次差分後

Rho _2

= 0

(14)

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

(15)

Quan_ARMA 15

Sample partial autocorrelation at lag k

 

 

  

2,3,...

k if 1

1 k if

1

1

, 1 1

1 , 1 1

k

j j k k

j

j k j k k

kk

r r

r r

r

r r

s

1/2

) n (

1

rkk 

PACF : partial autocorrelation function 部份自相關函數, 由 r

kk

, k= 0,1,2,…..組成的函數

• Standard error of r

kk

:

•ACF 及 PACF 是辨識 Box-Jenkins 模式的重要

工具

(16)

Dickey-Fuller test Phillips-Perron test

Random-walk with drift test

13.3.2 平穩性質的檢定

檢定法:

Dickey-Fuller test Test H

0

: ρ = 1

(17)

Quan_ARMA 17

Dickey-Fuller test

Augmented Dickey-Fuller Unit Root Tests

Type Lags Rho Pr < Rho Tau Pr < Tau F Pr > F

Zero Mean 0 0.1516 0.7175 1.12 0.9324

1 0.1481 0.7166 0.86 0.8952

2 0.1604 0.7196 1.12 0.9325

Single Mean 0 -2.6091 0.7025 -1.61 0.4745 2.10 0.5348

1 -3.6184 0.5796 -1.76 0.3994 2.07 0.5441

2 -3.1611 0.6344 -1.84 0.3591 2.53 0.4264

Trend 0 -2.6251 0.9505 -0.88 0.9554 1.29 0.9188

1 -5.2583 0.7982 -1.37 0.8665 1.67 0.8448

2 -3.1727 0.9283 -0.99 0.9419 1.69 0.8407

三種方法 p-值,p-值

<.05, 平穩性顯著

設平 均 0

設有 平均

設有 直線 走勢

原資料,或取一、

二次差分後結果

通常看此列

(18)

13.4 ARMA模式

• ARMA模式適用於Stationary series (平穩序列)。

• 對於不規則震盪,可用ARMA模式來解釋序列中的自相 關現象

AR:autoregression 自迴歸,是依變數的自行迴歸

MA:moving average 移動平均,是誤差項的加權和

二者都是將前段時間的資訊納入迴歸模式中,來對目

前的觀察現象作解釋

(19)

...

Z t     t   1t 1    qt q

Quan_ARMA 19

AR(p), Autoregressive model with order p is defined as

t p

t p 1

t 1

t

Z ... Z

Z    

  

 

MA(q), Movingaverage model with order q is defined as

ARMA(p,q), Autoregressive and movingaverage with order (p,q) is defined as

...

... 1 1

1

1 t p t p t t q t q

t Z Z

Z                

註: white noise : 純雜訊 ε

t

~ NID( 0, ζ

2

) δ是一constant, 並不一定是μ

Let Z

t

be a stationary series, ε

t

be white noise process

(20)

註:

1、 AR(p) model 可以下列式表示 (assume δ=0)

(B)

or Z

, ) ...

1

(   1     t    t

q q t

t B B

Z

ity) (stationar

0 )

(

(B) or Z

(B)Z

or

) ...

1

(

1 t t 1

滿足平穩性 之根需在單位圓外,始

B

Z B

B

p p t

t

t

t

2、 MA(q) model 可以下列式表示:

上式的B是後向運算,當 p=1 時,1-α B=0 之根在單位圓外的意思

是根的絕對值大於1,即,|α|<1

(21)

Quan_ARMA 21

)

(B

) B (

) B ( t

t

t ( B ) or, Z Z

) B

(    

3、 ARMA(p,q) model 可以下列式表示:

)

(B

是 B 的 p 次多項式,

是 B 的 q 次多項式,

4、 在SAS的報表中將使用 B 的符號表示模式

(22)

MA(q) model

2 2

2 1

2

( 1  ...  ) 

Z

   

q

) , 0 (

~ )

(

...

t 2

1

1

     

B N

Z

t

 

t

t

 

q tq

 

t

 

 

 

 

q q

q

q

q q

) ...

1 (

...

...

) ...

1 (

...

2 2

1

2 2

1

1 2

1 1

1

 

 

Z

t

之變異數及自相關係數:

Movingaverage with order q:

ACF

(23)

Z t 偏自相關係數 (partial autocorrelation):

...

...

2 1

2 1 2

22 1

1 11

 

 

Quan_ARMA 23

For MA model,ACF cuts off (截斷) at lag q,

PACF dies down(緩慢消失).

(24)

MA(1) model



 

  

 

2 k

for

, 0

) 1

( :

ACF

k

2 1 1

1

  11 2   1   1  0

1

|

| , ) 1

(

1 1

1

1

   

  

t

 

t

  

t

t

B

Z

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

} 1

/{

} 1

{

:

PACF 

kk

  

1k

 

12

 

12(k1)

由此得到估計量 係數

(25)

Quan_ARMA 25

(26)

MA(2) model

 

 

  

 

 

3 for

, 0

) 1

(

) 1

( :

k

2 2 2

1 2 2

2 2 2

1

2 1 1 1

k ACF

  

 

 

2 ,

2 1

1   

t t t

Z t      

由此得到參 數估計量

(27)

Quan_ARMA 27

(28)

AR(p) model

2 2

2 1

2

( 1  ...  ) 

Z

   

q

Autoregressive with order p

t t

t p

t p t

t

B Z

Z Z

) ( Z

Z

(B)

, 0

, ...

1 t

t 1

1

此模式滿足平穩性的條件:係數使得方程式 的 根在單位圓外

Variance for AR(p) model

Autocorrelation for AR(p) model

0 ) ( 

B

(29)

Quan_ARMA 29

Partial Autocorrelation for AR(p) model

...

...

, ...

, ...

1 1 2

2 1

1

2 1

3 2

1 1 2

1 2

3 1

2 1

1

 

 

p p

p p

p

p p

p p

稱為

Yule-Walker 等式, 由此得到估計量

1 for

, 0

...

,

2 2 2 1 2

22 1

1 11

kk

k p

For AR model,ACF dies down, PACF cuts off at lag p.

ACF

(30)

1

|

|

B)Z -

(1 or

,

: ) 1 (

1

t 1

1 1

t t t

t Z

Z AR

Stationarity 之條件

ACF 呈指數下降,或波動下降;PACF 在 k=2 處切斷

2 for

0

,

:

,

:

1 11

1 k

1 1

k PACF

ACF

kk

k

1

ˆ

1

   估計量:

...

, 0

, 8 . 0

, ) 8 . 0 (

, 8 .

1

0

k k

例:Z

t

= 6 - 0.8 Z

t-1

+ ε

t

(31)

Quan_ARMA 31

(32)

之根在單位圓外

(B)

B -

B -

1 (B)

,

: ) 2

(

1 1 2 2 1 2 2

  

t

t

t

 

t

Z Z

Z AR

Stationarity

Yule-Walker 等式 :

之條件

2 1

1 2

1 2 1

1

2 2 1 2 1

2 1 2

1 1



 

 

3 for

, 0

,

,

22 2

1

11

     φ

kk

k

例:Z

t

= Z

t-1

- 0.6Z

t-2

+ ε

t

   

(33)

Quan_ARMA 33

(34)
(35)

ARMA(p,q) model

, ...

... 1 1

1

1 t q t q t p t p

t

t Z Z

Z                

Quan_ARMA 35

若 q<= p,則 ACF 遞減

( damped exponentially or sine-wave )

若 q > p,前面 q-p+1 個 p 和其它的 p 呈二段式遞減

(36)

1

|

| 1,

|

| ,

: ) 1 , 1 (

1 1

1 1

1

1    

   t t   t  

t Z

Z ARMA

2 k

,

,

1 1

2 - 1

) )(

1 ( 1

1

1 1 2

1

1 1 1 1



 

k k

ACF 與 PACF 皆漸漸消失型 (damped exponentially or sine-wave)

1  

 

(37)

Quan_ARMA 37

(38)

ARMA model 中 acf 與 pacf 的表象

Model acf Pacf

MA(q) 時差 q 之後切斷 指數或正弦函數式漸漸消失 AR(p) 指數或正弦函數式漸漸消失 時差 p 之後切斷

ARMA(p,q) 指數或正弦函數式漸漸消失 指數或正弦函數式漸漸消失

以上列出的 acf 與 pacf 的特性將作為辨識 ARMA模式 適合性的準則。

(39)

13.5 ARMA 建模的步驟

1) Stationize: 檢測序列的平穩性,對不平穩的序列,

差分轉換為平穩序列。

2) Tentative identification: 由資料的 acf, pacf 辨識適合 的 ARMA模式, 選出數個可能模式。

3) Estimation: 對遴選模式估計參數

4) Diagnostic Checking: 由各種診斷法來檢視模式的適 合性,挑選出一模式,視為用於預測的模式

5) Forecasting: 以最終模式預測未來值 6) 應隨時做模式的更新。

Quan_ARMA 39

(40)

(1) 平穩化過程

• 如果手中的時序資料不是 stationary,以一次差分轉換,

使成為一 stationary series,必要時用多次差分。

• 利用檢定確認它是一 平穩序列

(41)

(2) 初步辨識

• 由樣本的acf 及pacf 的走勢及變化來辨識ARMA模式中的 p,

q值

• 選出數個候選模式

• 模式應力求簡單

Model acf Pacf

MA(q) 時差 q 之後 截 斷 指數或正弦函數式漸漸消失 AR(p) 指數或正弦函數式漸漸消失 時差 p 之後 截 斷

ARMA(p,q) 指數或正弦函數式漸漸消失 指數或正弦函數式漸漸消失

Quan_ARMA 41

(42)

(3) 參數估計

• 原則上用 least square estimate

• 估計的係數必滿足 平穩性及可逆性之條件

• ARMA 係數的估計有時需以遞迴的數值法得

解,有可能遇到不收歛情況

(43)

Quan_ARMA 43

例 : 一平穩序列,依據下列現象分別以 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 | ****| .

(44)

以 AR(1) 配適:

Conditional Least Squares Estimation Parameter Estimate Standard

Error

t Value Approx Pr > |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 Zt

No mean term in this model.

Autoregressive Factors

Factor 1: 1 + 0.44383 B**(1)

(45)

Quan_ARMA 45

以 MA(1) 配適:

Conditional Least Squares Estimation

Parameter Estimate Standard Error t Value Approx Pr > |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 Zt

No mean term in this model.

Moving Average Factors

Factor 1: 1 - 0.64635 B**(1)

(46)

以 ARMA(1,1) 配適:

Model for variable Zt

No mean term in this model.

Autoregressive Factors Factor 1: 1 - 0.37117

B**(1) Conditional Least Squares Estimation

Parameter Estimate Standard Error t Value Approx Pr > |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

(47)

(3) 模式診斷

• 一個適合的模式需滿足:殘差為 white noise、

及係數顯著

• 若殘差不為 white noise,表示仍有自相關現 象存在於殘差內,所選的階數不夠

• 若係數不顯著,表示自變數之間有相關性,

參數個數太多,所選的階數超過

Quan_ARMA 47

(48)

殘差為 white noise 之檢測:

1、autocorrelation check for residual (chi-square test) H

0

:ρ

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 的

(49)

(4) 選取預測式

當我們得到了數個適合的模式,比較 AIC、 SBC、標準誤、

以及相關的適合現象,最後選一最理想的做為預測式。

原則上,預測式愈簡單愈好。

Quan_ARMA 49

AIC, SBC 模式判定值

AIC k = n ln(SSE k ) – n ln(n) + 2k

SBC k = n ln(SSE k ) – n ln(n) + ln(n) k

此處 SSE 為誤差平方值, k 為估計參數個數 ,判定值愈小,模式

愈佳。

(50)

例題: 一、以 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

(51)

Quan_ARMA 51

三、以 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 Parameter Estimates

Parameter MA1,1 AR1,1

MA1,1 1.000 0.117

AR1,1 0.117 1.000

共線性現象微弱

另由殘差的 ACF PACF 顯示 無自相關

(52)

參數顯著性 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) 最適合資料,選定預測式為 Y

t

= ε

t

– 0.646 ε

t-1

, S = 1.054

三模式比較

(53)

13.6 Case Study

DVD weekly sale series

Quan_ARMA 53

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

原始資

料序列

(54)

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

(55)

Quan_ARMA 55

Step 1.2、差分一次,平穩性檢測

Autocorrelations La

g

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

一次差分資料為平穩序列

(56)

Step 2、遴選模式及診斷 (設定平均數為 0)

觀察 ACF, PACF; r1>0 r6>0 acf dies down

r11>0 r22>0 pacf dies down

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 | . | . |

PACF

(57)

Quan_ARMA 57

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 Approx

Pr > |t|

Lag

AR1,1 0.44279 0.07159 6.19 <.0001 1

(58)

Step 2.2、模式2 ARMA(1,1)

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

(59)

Quan_ARMA 59

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 Paramete

r

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 Approx Pr >

|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

(60)

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 Approx Pr >

|t|

Lag

MA1,1 -0.55465 0.06761 -8.20 <.0001 1

AR1,1 -0.32052 0.08004 -4.00 <.0001 6

Correlations of Parameter Estimates

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

(61)

Quan_ARMA 61 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 Approx Pr >

|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 Parameter Estimates

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

(62)

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 Parameter Estimates

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 Approx Pr >

|t|

Lag

MA1,1 -0.61177 0.05499 -11.13 <.0001 1

MA1,2 0.32354 0.05476 5.91 <.0001 6

Autocorrelation 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

(63)

Quan_ARMA 63

參數 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: B

MA: 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

(64)

Step 3 預測式

, ) 324

. 0 612

. 0 1

( 6 t

t B B

Z    

Sample mean = 59.3

t t

t t

t

t t

Y Y

B B

Y B

 1 1 6

6

324 .

0 612

. 0

or , ) 324

. 0 612

. 0 1

( )

1

(

(65)

Quan_ARMA 65

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星期的預測區間

(66)

參考文獻

相關文件

 The novel coronavirus outbreak has drawn increased international attention as the virus quickly spreads across the world..

自從 Engle(1982)提出 ARCH 模型以來,已經超過 20 年,實證上也有相當多的文獻 探討關於 ARCH 族模型的應用,Chou(2002)將 GARCH

2-1 註冊為會員後您便有了個別的”my iF”帳戶。完成註冊後請點選左方 Register entry (直接登入 my iF 則直接進入下方畫面),即可選擇目前開放可供參賽的獎項,找到iF STUDENT

甲型禽流感 H7N9 H7N9 H7N9 H7N9 H7N9 H7N9 H7N9 H7N9 - - 疾病的三角模式 疾病的三角模式 疾病的三角模式 疾病的三角模式 疾病的三角模式

/** Class invariant: A Person always has a date of birth, and if the Person has a date of death, then the date of death is equal to or later than the date of birth. To be

Data from the 1000 Genomes Project will be made available quickly to the worldwide scientific community through freely accessible public databases... 幕後英雄

 Negative selection: if the antibodies of a B cell match any self antigen in the bone marrow, the cell dies.  Self tolerance: almost all self antigens are presented i n

– If all the text fits in the view port then no scroll bars will be visible If all the text fits in the view port, then no scroll bars will be visible