# PROBLEM 6
#Plot the theoretical ACFs (all derived in the class) of the three series AR(1)=ARMA(1,0) Xt = ϕXt−1 +Wt, MA(1)=ARMA(0,1) Xt = Wt +θWt−1, and ARMA(1,1) Xt = ϕXt−1 +Wt +θWt−1 on the same graph for ϕ = 0.6, θ = 0.9, and comment on the diagnostic capabilities of the ACF in this case
par(mfrow = c( 1,1))
ar1 = ARMAacf( ar = 0.6, ma = 0, lag.max = 20)
ma1 = ARMAacf( ar = 0, ma = 0.9, lag.max = 20)
arma11 = ARMAacf( ar = 0.6, ma = 0.9, lag.max = 20)

plot( ar1[-1], type = "o", col = 2, xlab = "LAG", ylab = "ACF")
lines( ma1[-1], type = "o", col = 3)
lines( arma11[-1], type = "o", col = 4)
legend("topright", c( "ARMA", "AR", "MA"), col = c( 4, 2, 3), lty = 1)