Академический Документы
Профессиональный Документы
Культура Документы
Problem 3.9:
Generate n = 100 observations from each of the three models discussed in Problem,3.8. Compute the sample
ACF for each model and compare it to the theoretical values. Compute the sample PACF for each of the
generated series and compare the sample ACFs and PACFs with the general results given in Table 3.1.
#Theoretical Values:
#ARMA(1,1)
acf.arma=ARMAacf(ar = .6, ma = .9, lag.max = 20, pacf = FALSE)
pacf.arma=ARMAacf(ar = .6, ma = .9, lag.max = 20, pacf = TRUE)
#ARMA(1,0)
acf.ar=ARMAacf(ar = .6, ma = 0, lag.max = 20, pacf = FALSE)
pacf.ar=ARMAacf(ar = .6, ma = 0, lag.max = 20, pacf = TRUE)
#ARMA(0,1)
acf.ma=ARMAacf(ar = 0, ma = .9, lag.max = 20, pacf = FALSE)
pacf.ma=ARMAacf(ar = 0, ma = .9, lag.max = 20, pacf = TRUE)
par(mfrow=c(2,3))
plot(acf.arma, type ='h', main="ACF of ARMA(1,1)")
abline(h=0)
plot(acf.ar, type ='h', main="ACF of ARMA(1,0) - AR(1)")
abline(h=0)
plot(acf.ma, type ='h', main="ACF of ARMA(0,1)- MA(1)")
abline(h=0)
plot(pacf.arma, type ='h', main="PACF of ARMA(1,1)")
abline(h=0)
plot(pacf.ar, type ='h', main="PACF of ARMA(1,0)- AR(1)")
abline(h=0)
plot(pacf.ma, type ='h', main="PACF of ARMA(0,1) - MA(1)")
abline(h=0)
1
0.8
ACF of ARMA(1,1) ACF of ARMA(1,0) − AR(1) ACF of ARMA(0,1)− MA(1)
0.8
0.8
acf.arma
acf.ma
acf.ar
0.4
0.4
0.4
0.0
0.0
0.0
5 10 15 20 5 10 15 20 5 10 15 20
0.6
0.4
pacf.arma
0.4
0.2
pacf.ma
pacf.ar
0.0
0.2
−0.2
−0.4
0.0
5 10 15 20 5 10 15 20 5 10 15 20
2
Series ARMA Series AR Series MA
1.0
1.0
1.0
0.6
0.6
0.6
ACF
ACF
ACF
−0.2 0.2
0.2
0.2
−0.2
−0.2
0 5 10 15 20 0 5 10 15 20 0 5 10 15 20
0.4
0.2 0.4
Partial ACF
Partial ACF
Partial ACF
0.4
0.2
0.0
−0.2 0.0
−0.2
−0.6
5 10 15 20 5 10 15 20 5 10 15 20
Comparision:
ARMA(1,1) model: both the theoretical and sample ACF and PACF values tails off.
AR(1) model: Theoretical ACF tails off and PACF cuts off after lag 1, sample ACF tails off and sample
PACF cuts off after lag 1.
MA(1) model: Theoretical ACF cuts off and PACF tails off, sample ACF cuts off after lag 1 and sample
PACF tails off.
In general, both theoretical and sample ACF and PACF’s are similar for all models, but as the sample size
get larger the sample ACF and PACF should become more similar to theoretical values.