Hey guys, in this video I'm going to do this time series problem.
For this problem, we're given an AR(2) model here
and we're asked to find the closed-form solution for the autocorrelation function rho(h).
So for these types of problems,
we're asked to find the ACF or autocorrelation function of a causal AR(2).
This is a special type of problem because it has basically a nice closed-form formula
but what the formula is could be one of three cases.
There's basically two steps for this type of problem.
The first thing you want to do is calculate the roots of the AR(2) model.
So I'm going to put calculate the phi(z) roots.
And this will essentially give you r1, r2 and then the formula is
one of three possible cases depending on what roots you get.
In the first case, r1 and r2 can be two distinct real roots.
The first case is if you have two real roots, in which case the autocorrelation
function is going to have the following formula.
It's going to have c1 times z1 to the negative h plus c2
z2 to the negative h.
The second possible case is if you have one repeated real root.
This is when r1 is equal to r2
and in that case, the formula is going to be z0 to the negative h times c1 plus c2
times h. And the third possible case is that you have a complex number and you have a
complex conjugate pair as r1 and r2. For case 3, I'm going to put
complex conjugate pair, in which case the formula is a little bit more complex.
It's going to be rho(h) is equal to a times the magnitude of c1 to the negative h times
cosine of h theta plus b.
In this case what you're going to get as your real roots
is that z is a complex number a plus bi and then the conjugate of that would be a
minus bi. And so
the real part of this complex number is the a, then the imaginary part is the b
and z is going to be the magnitude of the complex number.
The formula for z1, or the
formula for the magnitude of z1, is going to be the square root of a squared plus b squared
and then to get theta, the formula for that is that theta is equal to tan inverse b over a.
These are all the formulas you need for the third case. And this example that we're going to do is going to be case number
three. The roots are going to be an imaginary conjugate pair. So let's go ahead and get started with the problem.
Like I said, the first thing I'm going to do is find the causal roots.
For this AR(2) that we're given, that's going to be 1 minus the phi(1) coefficient,
which is minus square root 2 over 2
z plus
1/4 z squared, and that's going to be set equal to 0 to find the roots.
I'm going to rearrange the numbers, so that will be 1/4 Z squared minus
square root 2 over 2 z plus 1 is equal to 0 and then before I do the quadratic formula,
I'm going to get rid of the denominators. So I'm going to multiply by 4 on both sides
and that's going to give us z squared minus
2 square root 2 z plus 4 is equal to 0. Now I'm going to use the quadratic formula.
That's going to give me 2 square root 2 plus or minus the square root of 2 square root 2 is 8
minus 4 times 4 times 1 divided by 2 times 1, which is just 2. Then when we simplify
what's in the square root, that's going to be the square root of 8i
divided by 2, which is equal to 2 times the square root of 2i
divided by 2. If we divide by 2 for the real part as well,
then our roots are going to be square root of 2 plus or minus square root of 2i.
So from this complex number we have that a is equal to square root of 2 and b,
the imaginary part, is equal to square root of 2 as well.
In this case, we're going to have that
the magnitude of z is equal to the square root of 2 squared plus square root of 2 squared.
That's just the square root of four,
which is going to be equal to 2 and then to find theta that's going to be tan inverse
square root of 2 divided by square root of 2, which is tan inverse
of 1, which is going to give us pi over 4.
Now we can plug into the formula, which was rho(h) is equal to a
times the magnitude of z to the negative h times cosine h times theta plus b.
And like we said, we have that a is equal to the square root of two.
The magnitude was equal to 2.
So 2 to the negative h times cosine. Theta we have is pi over 4
times h plus the square root of 2.
And this is our final answer. And we're done with this problem.
*chiptune music*