模型判断:
- Step1 看ACF图:
– ACF截尾:判断为MA(q)模型,q为最后一个超出2倍标准差(蓝线)的阶数 – ACF拖尾:可能为AR( p)模型也可能为ARMA(p,q)模型 - Step2 看PACF图:
– PACF截尾:AR( p)模型,p为最后一个超出2倍标准差(蓝线)的阶数 – PACF拖尾:ARMA(p,q)模型,ACF和PACF看不出阶数,通过eacf定阶
【注1】ACF图第一根竖线的阶数为零,MA(1)有两根竖线超出蓝线,但第二根的阶数不是2是1,以此类推
(1) MA MA(1):
x
t
=
ε
t
+
0.4
ε
t
?
1
x_t = \varepsilon_t + 0.4\varepsilon_{t-1}
xt?=εt?+0.4εt?1? MA(2):
x
t
=
ε
t
+
0.4
ε
t
?
1
?
0.7
ε
t
?
2
x_t = \varepsilon_t + 0.4\varepsilon_{t-1} - 0.7\varepsilon_{t-2}
xt?=εt?+0.4εt?1??0.7εt?2? MA(3):
x
t
=
ε
t
+
0.4
ε
t
?
1
?
0.7
ε
t
?
2
+
0.5
ε
t
?
3
x_t = \varepsilon_t + 0.4\varepsilon_{t-1} - 0.7\varepsilon_{t-2} + 0.5\varepsilon_{t-3}
xt?=εt?+0.4εt?1??0.7εt?2?+0.5εt?3?
ma1 <- arima.sim(n=1000, list(ma=0.4))
ma2 <- arima.sim(n=1000, list(ma=c(0.4,-0.7)))
ma3 <- arima.sim(n=1000,list(ma=c(0.4,-0.7, 0.5)))
par(mfcol=c(2,3))
ma1a <- acf(ma1)
ma1p <- pacf(ma1)
ma2a <- acf(ma2)
ma2p <- pacf(ma2)
ma3a <- acf(ma3)
ma3p <- pacf(ma3)
(2) AR AR(1):
x
t
=
0.8
x
t
?
1
+
ε
t
x_t = 0.8x_{t-1}+\varepsilon_t
xt?=0.8xt?1?+εt? AR(2):
x
t
=
?
x
t
?
1
?
0.5
x
t
?
2
+
ε
t
x_t = -x_{t-1}-0.5x_{t-2}+\varepsilon_t
xt?=?xt?1??0.5xt?2?+εt? AR(3):
x
t
=
x
t
?
1
?
0.5
x
t
?
2
+
0.3
x
t
?
3
+
ε
t
x_t = x_{t-1} - 0.5x_{t-2} + 0.3x_{t-3}+\varepsilon_t
xt?=xt?1??0.5xt?2?+0.3xt?3?+εt?
ar1 <- arima.sim(n=1000, list(ar=0.8))
ar2 <- arima.sim(n=1000, list(ar=c(-1,-0.5)))
ar3 <- arima.sim(n=1000, list(ar=c(1,-0.5,0.3)))
(3) ARMA(p,q) ARMA(1,1):
x
t
=
0.8
x
t
?
1
+
ε
t
+
0.4
ε
t
?
1
x_t = 0.8x_{t-1} + \varepsilon_t + 0.4\varepsilon_{t-1}
xt?=0.8xt?1?+εt?+0.4εt?1? ARMA(2,1):
x
t
=
0.8
x
t
?
1
?
0.4
x
t
?
2
+
ε
t
+
0.4
ε
t
?
1
x_t = 0.8x_{t-1} - 0.4x_{t-2} + \varepsilon_t + 0.4\varepsilon_{t-1}
xt?=0.8xt?1??0.4xt?2?+εt?+0.4εt?1? ARMA(1,2):
x
t
=
0.8
x
t
?
1
+
ε
t
+
0.4
ε
t
?
1
+
0.7
ε
t
?
2
x_t = 0.8x_{t-1} + \varepsilon_t + 0.4\varepsilon_{t-1} + 0.7\varepsilon_{t-2}
xt?=0.8xt?1?+εt?+0.4εt?1?+0.7εt?2?
arma11 <- arima.sim(n=1000,list(sr=0.8,ma=0.4))
arma21 <- arima.sim(n=1000,list(ar=c(0.8, -0.4),ma=0,4))
arma12 <- arima.sim(n=1000,list(ar=0.8, ma=c(0.4,0.7)))
|