# How to plot spectra of an AR(2) process

I am stuggling with this problem and was hoping to find some guidance to answer it.

Let $y_t=\phi_1y_{t-1}+\phi_2y_{t-2}+\epsilon_t$, with $\epsilon_t\sim N(0,1)$. Now, I want to plot the spectra of $y_t$ in the following cases:

Case 1: When the AR(2) characteristic polynomial has two real reciprocal roots given by $r_1=0.9$ and $r_2=-0.95.$

Case 2: When the AR(2) characteristic polynomial has a pair of complex reciprocal roots with modulus $r=0.95$ and frequency $2\pi/8$.

Now, before plotting the spectra of $y_t$ in the following cases, I have tried to make use of the following important facts. The AR(2) process $y_t=\phi_1y_{t-1}+\phi_2y_{t-2}+\epsilon_t$ has the general linear process form $\psi(u)=1/(1-\phi_1u-\phi_2u^2)$ and hence $$f(\omega)=\frac{v}{2\pi}|(1-\phi_1e^{-i\omega}-\phi_2e^{-2i\omega})|^{-2}$$ This can be expanded to give $$f(\omega)=\frac{v}{2\pi[1+\phi^2_1+2\phi_2+\phi_2^2+2(\phi_1\phi_2-\phi_1)\cos(\omega)-4\phi_2\cos^2(\omega)]}$$ Now if the roots are real, then $f(\omega)$ has a mode at either zero or $\pi$; otherwise, the roots are complex conjugates and $f(\omega)$ is unimodal at $\omega=\arccos[-\phi_1(1-\phi_2)/4\phi_2]$ lying strictly between zero and $\pi$.

So if anyone could help explain to me how I am supposed to relate the above facts with the two different case that would be very helpful. I guess what I am struggling with is what values to plug into $f(\omega)$.

• This is more a question for better understanding your question (though I know you've figured out the answer). Can you please help me understand how you arrived at this: - "The AR(2) process y t =ϕ 1 y t−1 +ϕ 2 y t−2 +ϵ t has the general linear process form ψ(u)=1/(1−ϕ 1 u−ϕ 2 u 2 ) and hence.." I'm not able to understand how you arrived at a general linear process form. Pardon my ignorance! Nov 1, 2013 at 6:23

I figured it out. When the reciprocal roots are real we will have that $$\phi_1=(r_1+r_2)\hspace{.1in}\text{ and }\hspace{.1in}\phi_2=-r_1r_2$$ Likewise when the reciprocal roots appear as a complex pair then we have that $$|\phi_1|=2r\cos(\omega)\hspace{.1in}\text{ and }\hspace{.1in}\phi_2=-r^2$$
Thus I can just plug that into the above equation and plot as a function of $\omega$.