Hello everyone in this election we will talk about the Ljung-Box Q-statistic.
So objective is to define Ljung-Box Q-statistic.
Will learn how their the decision rule to test an null
hypothesis that the several autocorrelation coefficients are zero.
And we'll learn how to test the null hypothesis that several autocorrelation
coefficients are zero using R.
Let me tart with Portmanteau statistic in 1970,
Box and Pierce proposed the following statistic which is just Q*(m).
It is the time,t he length of the time series is multiplied
with the sum of the squares of the sample of the correlation coefficients until m.
And they propose this for testing the null hypothesis that more than one.
Let's say m many of the correlation coefficient zero against the alternative
hypothesis that there is some rho i for i in between one and m that's not zero.
So either all of them are zero or
against that there's at least one of these guys that's not zero and
they used Q*(m) statistic to test this null hypothesis.
They showed that under some conditions Q*(m) has asymptotically
Chi-Squared distribution, with degrees of freedom m.
Then Ljung and Box in 1978, they modified this statistics
to increase the power of the test for a finite samples.
And there test is that Q(m) is equal to now.
The length of the time series*(the length of the time series+2)*the sum,
this time the sum is actually divided by T-l.
Decision rule is going to be the following.
We're going to look at the Q(m) and
if Q(m) is large enough then we reject the null hypothesis, now how large enough?
Well if it is larger than 100(1- alpha) quantile in the Chi-Squared
distribution with m degrees of freedom.
Now most packages actually give you the p-value.
So we're going to reject the null hypothesis if p value is
sufficiently small.
So if p value is less than some alpha, let's say alpha is 0.05, our significance
level you're going to reject that the idea that there is no auto-correlation.
Now how are are we going to use this?
Well, when we start with this time series's were going to use this q
statistic to see if there is autocorrelation.
Then if there is autocorrelation were going to try to fit our models.
And once they fit the model then there will be residuals hopefully a white nulls.
Now then we're going to look at the residuals,
we shouldn't see n alpha correlation.
So we're going to use this test for
the residuals to see if there's a autocorrelation or not as well.
Now the question is what is this m?
How large do we take m?
It is usually taking as the lower than ln, of the length of the time series.
And in the R, we're going to use this Box.test routine
to actually carry out all of our calculations.
So what have we learned?
We have learned the definition of the Ljung-Box Q-statistic.
We learned the decision rule to test the null hypothesis that
several auto-correlation coefficient are zero.
We also learned to test the null hypothesis
that several auto-correlation coefficients are zero using R.
In the next lecture we'll actually look at the real life time series.
And we're going to use all of the tools that we have acquired until now.
We have a lot of them now.
And we're going to try to fit our real life model into the real-life data set.