Hey guys, in this video I'm going to go over this time series problem.
It says, assume that the
observations X1, X2,
and also X4--we're not going to use that in this problem--are from the MA(1) model and then it gives you
the following MA(1) model. Find the best linear predictor of the missing
value X3 in terms of X1 and X2 and compute the mean squared errors for the best linear predictor.
This is telling you you have an MA(1) and it's asking you to find the best linear predictor for
the third term and
assuming you're given the first two terms.
The general formula for this would be X3 is equal to a0 plus a1
Xn plus a2
Xn-1. And in this case, that's going to be a0 plus a1 X2 plus
a2 X1 and we have to solve--this is a linear combination of
constants and
variables--and we have to basically solve for a0, a1, and a2. Let's go ahead and
get started.
The formula for the intercept a0 is often 0 but the formula for that is mu
1 minus the autocorrelation
function at lag h.
And for the MA(1) model,
if you do the expected val--mu is equal to the expected value of Xt--and for the moving average model
that's just going to be 0.
So a0 is going to be 0 and oftentimes when I do these problems a0 is equal to 0
but you do have to prove it before you move on.
Really we just have to find a1 and a2. To find that I'm going to
do some matrix multiplication.
The way I think of having to do this is on the left-hand side,
my left-hand vector is going to be the autocovariance functions of the predictor and the covariates.
In this case the covariates are X2 and X1. I'm going to do the covariance of X3, X2;
covariance of X3, X1; and that's my
left-hand side vector is equal to--and then for this matrix, I do a
covariance matrix of the covariances and variances of the covariates. I know covariates and covariance
sound the same
but I mean that this is going to be the covariance
of X2 X2. In other words, the variance of X2. And this is going to be the
covariance of X2 and X1. This is going to be the covariance of X1 X2
and this is going to be the
covariance of X1 X1. And I'm going to multiply that by what we're looking for, which is--
which are a1 and a2. We can rewrite this using just gamma and then these are just lags.
This is going to be the autocovariance function
for a lag of 1. So from X3 to X2 that's just 1 lag. From X3 to X1 that's two lags.
It's gamma(2) is equal to gamma(0), which is also the variance. This is equal to gamma(1), gamma(1),
gamma(0) and
before I try
to multiple and then solve for a1 a2, I'm going to convert the autocovariance
functions--so the gammas--into rhos, the autocorrelation functions.
The formula for that is that rho(h) is equal to gamma(h)
divided by gamma(0). Really what it we're just doing is for every element that has a gamma,
we're just going to divide by gamma(0) and this will make the multiplication more simple later on.
This is going to be rho(1). This is going to be rho(2). Is equal to--
gamma(0) divided by gamma(0) is just 1, so the main diagonal has turned into 1.
This is going to be rho(1), rho(1), a1, a2.
For lag 2 on a MA(1) model, lag 2--
anything greater than lag 1 will be 0--so this is just 0.
When you divide by the variance you're still going to get 0, so this is just 0. And now we've simplified the multiplication--
the matrix multiplication. Let's go ahead and write out the two equations that this gives us.
That's going to be rho(1) is equal to a1 plus a2
rho(1), or rho(1) a2. And then the second line gives us 0 is equal to rho(1)
a1 plus a2. Then what I did was I solved for a2. That's going to be equal to negative
rho(1) a1. And I plugged that into the first equation.
So rho(1) is equal to a1 plus rho(1) and then I plugged in a(2). That's negative
rho(1) a1. So rho(1) is equal to a1 plus or minus rho(1)
squared a1. Let's factor out an a1. That's 1 minus rho(1) squared.
A1 is equal to rho(1)
over 1 minus rho(1)
squared. And now let's solve for a2
by plugging back in a1. It's going to be negative rho(1) times
rho(1) divided by 1 minus rho(1)
squared. It's going to be negative rho(1)
squared over 1 minus rho(1)
squared and if we want to get rid of the negative on the numerator that's going to be rho(1) squared over
rho(1) squared minus 1. We're just multiplying by negative 1 on the numerator and the denominator.
And now we know that the best
linear predictor for X3 given X1 and X2 is
a1 times X2. That's going to be rho(1) over 1 minus rho(1) squared
X2 plus a2 X1. That's going to be rho(1) squared over
rho(1) squared minus 1 X3 and I would leave it just like that.
And I guess if you want to prove that you know what rho(1) for an
MA(1) model is that's going to be gamma(1) over gamma(0). So the variance for an MA(1)
model is
sigma squared times 1 plus theta squared and
for lag 1, the covariance is going to be sigma squared theta.
So rho(1) is just theta over 1 plus theta squared. This is your final answer for the best linear predictor and
the second part of the
question says to basically compute the mean squared predictive error.
There's a formula for that as well, and that is
gamma(0) minus An
transpose
times gamma(h). Gamma(0), we've already said that's sigma squared 1 plus
theta squared
minus--this is just the vector of the constants that we were trying to find.
That's a1 a2.
And then this, I always just think of it as the left hand side of the equations that we already solved for.
That's going to be gamma(1) 0.
And if we multiply
these two vectors, that's going to be a1 gamma(1). That's going to be equal to
sigma squared times 1 plus theta squared minus--what's a1? A1 is rho(1)
over 1 minus rho(1) squared and then gamma 1 is just sigma squared theta.
This is our final answer for the mean squared predictive error.
And we're done with this problem.
*chiptune music*