0% found this document useful (0 votes)
16 views15 pages

Subject Business Economics

Uploaded by

Maadhav Sehgal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views15 pages

Subject Business Economics

Uploaded by

Maadhav Sehgal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

____________________________________________________________________________________________________

Subject BUSINESS ECONOMICS

Paper No and Title 8: Fundamentals of Econometrics

Module No and Title 18: Test for Autocorrelation

Module Tag BSE_P8_M18

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
TABLE OF CONTENTS
1. Learning Outcomes
2. Detection of Autocorrelation
2.1 Graphical Method
2.2 Runs Test
3. Durbin Watson tests for Autocorrelation
3.1 Durbin Watson d Test
3.2 Durbin's h Test
3.3- Durbin's m Test
4. Tests for Higher Order Autocorrelation
4.1 Wallis Test
5. Lagrange Multiplier Test
6. Portmanteau Test
6.1 Box Pierce Q Test
6.2 Ljung Box Q Test
7. Summary

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
1. Learning Outcomes

After studying this module, you shall be able to

 Know How to test for the presence of autocorrelation


 Learn Graphical detection of autocorrelation
 Learn about Runs test for detection of autocorrelation
 Use Durbin Watson test for detection of autocorrelation
 Use LM test for detection of higher order autocorrelation
 Use Q test for detection of higher order autocorrelation
 Use Wallis test for detection of fourth order autocorrelation

2. Detection of Autocorrelation

2.1 Graphical method

The presence of autocorrelation can be detected by looking at the residual plot. The graph
of estimated residuals may be plotted in several ways.
 We can plot the residuals against time
 We can plot the standardized residuals against time. The residuals are standardized by
𝑒
dividing the residuals by the standard error of regression. estd =
̂𝑢
√𝜎
these standardized residuals have mean zero and approximately unit variance. For large
n, they are also approximately distributed normally1.
 We can also plot the residuals against their lagged values. So, for an AR (1) scheme, et
may be plotted against et-1.

1
Gujarati D & Sangeetha, Basic Econometrics, Tata McGraw Hill India, 4 th ed, 2007,pp474

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________

Figure 1

Figure 2
BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS
ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________

Figure 3

2.2 The Runs test

It is a non-parametric test because it does not invoke any assumptions about the underlying
distribution of the disturbance term. This test is also called Geary test after, R C Geary who
first proposed it in 19702. A run may be defined as the continuous sequence of a “+” or “–
” attribute in the residuals. The length of a run may be defined as number of elements in it.
For example, we may observe residuals with the following pattern of signs:
(- - - - - - - - )(+ + + + + + + + + + + + +)( - - - - - - - - - )
Here, we observe 8 negative residuals, followed by 13 positive residuals, followed by 9
negative residuals for a total of 30 observations. When we observe that a positive residual

2
R C Geary, “Relative efficiency of count sign changes for assessing residual autoregression in least square
regression”, Biometrika, Vol 57, 1970 pp 123-127.

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
is followed by a positive residual for a large number of periods and similarly, a negative
residual is followed by a negative residual for a large number of periods then we say that
we are observing few but long runs, positive autocorrelation is said to be present. On the
other hand, if runs are short and change quickly then we can say that negative
autocorrelation is present.
Geary has also proposed a test of hypothesis to check if the runs are indicative of
autocorrelation. The test can be described in the following manner:
Let, N1 – number of residuals with + sign
N2 – number of residuals with - sign
N= N1 + N2 = Total number of observations
R- Number of runs
Now, R is asymptotically normally distributed with the following parameters:

2𝑁1 𝑁2
Mean, E(R) = +1
𝑁
2𝑁1 𝑁2 (2𝑁1 𝑁 2 − 𝑁)
Variance, 𝜎𝑅2 = (𝑁)2 (N−1)
The null hypothesis that can be tested is that the residuals are random. A table for critical
values of runs if N1 or N2 is less than 20 is also there.

3. Durbin Watson Tests for Autocorrelation

3.1 Durbin Watson (D-W) d Test

Durbin & Watson have defined the d statistic, based on the estimated residuals of the
regression
∑𝑛
𝑡=2(𝑢 ̂𝑡−1 )2
̂𝑡 −𝑢
d= ∑𝑛 ̂𝑡2
(1)
𝑡=1 𝑢
Assumptions underlying the d statistic
1. The regression model includes the intercept term.
2. The explanatory variables are non-stochastic
3. The disturbance term, ut is generated by first order autoregressive scheme,
4. The disturbance term, ut is distributed normally.
5. The regression model is not autoregressive, i.e., it does not include lagged values of the
dependent variable as one of the explanatory variables.
6. There are no missing observations in the data.

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________

Relationship between the d statistic and autocorrelation

𝑢̂𝑡 and 𝑢̂𝑡−1 are said to be approximately equal since they differ in only one observation,
therefore the value of d statistic mentioned in (1) may be written as

∑𝑢
̂𝑡 𝑢
̂𝑡−1
𝑑 ≈ 2 (1 − ̂𝑡2
∑𝑢
) (2)

If we define, 𝜌̂ as the estimator of ρ, the first order coefficient of autocorrelation in the


following way
∑𝑢
̂𝑡 𝑢
̂𝑡−1
𝜌̂ = ̂𝑡2
∑𝑢
(3)

Then the value of d statistic in (2) becomes

d ≈ 2(1-𝜌̂) (4)
∵ -1 ≤ρ ≤ 1, ∴ 2 ≤d≤4 (5)

From (5) it follows that


If, 𝜌̂ = 0, d = 2, i.e. no autocorrelation
𝜌̂ = +1, d ≈ 0, i.e. positive autocorrelation
𝜌̂ = -1, d ≈ 4, i.e. negative autocorrelation

To summarize, if no autocorrelation is present in the model then, the d statistic will take a
value equal to 2. If positive autocorrelation is present in the model then, the d statistic will
take a value close to 0. If negative autocorrelation is present in the model then, the d statistic
will take a value close to 4.
However, it is important to note that the sampling distribution of d under the null
hypothesis of no autocorrelation depends upon the values of the explanatory variables. So,
the critical values of d will also depend on the values of the explanatory variables. In order,
to overcome this problem Durbin –Watson, developed the lower and upper bounds of d,
namely dL and dU.
The probability distribution of dL and dU does not depend on the values of the explanatory
variables and they have the property that, dL< d < dU. Using this property the D-W d test
can be carried out to test for autocorrelation.
BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS
ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
The values for the lower and upper bounds of d are contained in the Durbin Watson
statistical tables.
Steps in D-W d Test

1. Find the estimated residuals after running the OLS regression.


2. Compute the value of d. These days, all statistical programmes compute this value
automatically.
3. Find the values of dL and dU from the Durbin Watson statistical tables
corresponding to the given sample size and the number of explanatory variables for
a given level of significance.
4. Determine whether autocorrelation exists or not and whether autocorrelation is
positive or negative, by carrying out the following hypotheses tests
(i) Test for positive autocorrelation
H0: ρ = 0 versus H1: ρ > 0
Null hypothesis states that there is no positive autocorrelation
(ii) Test for negative autocorrelation
𝐻0∗ : ρ = 0 versus H1: ρ < 0
Null hypothesis states that there is no negative autocorrelation
(iii) Test for any type of autocorrelation- positive or negative
H0 /𝐻0∗ : ρ = 0 versus H1: ρ ≠ 0
Null hypothesis states that there is no autocorrelation- positive or negative
5. Accept or reject any of the above hypotheses as per the following decision rule:w

Durbin Watson d test decision rules

Null Hypothesis Decision Condition

Hypothesis (i)
No positive autocorrelation Reject 0 < d < dL
No positive autocorrelation No decision dL ≤ d ≤ dU
Hypothesis (ii)
No negative autocorrelation Reject 4- dL < d < 4
No negative autocorrelation No decision 4- dU ≤ d ≤ 4- dL
Hypothesis (iii)
No autocorrelation Do not reject dU <d < 4- du

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________

Figure 4- Zones of decision for d statistic

Limitations of D-W test


1. The test is applicable only when the assumptions underlying the d statistic are fulfilled
2. The test can only be used for testing the presence of first order autocorrelation and not
higher order autocorrelations
3. The test contains zones of indecision, where it cannot conclusively determine the
absence or presence of autocorrelation.

3.2 Durbin’s h Test


When the regression model is autoregressive, the d statistic in the D-W test has a tendency
to be close to 2. Thus, it has a built in bias to accept the null hypothesis of no
autocorrelation, even when it is not true.
To get over one of this limitation, Durbin (1970) proposed the h test. If there is an
autoregressive regression model of the following kind:

Yt = 1Yt-1 + 2Yt-1 + pYt-p +p+1 X1t +…+ p+kXkt + ut (6)


Ut = ρ ut-1 + εt and ε ∼ N(0, 𝜎𝜖2 )

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________

Then, the value of h statistic is as under:

𝑑 𝑛
h = (1- 2 )√ ̂1 ) ∼ approx. N(0, 1)
1−𝑛 𝑣𝑎𝑟(𝛽

Where, var (𝛽̂1 ) is the estimated variance of 𝛽̂1


d is the D-W statistic, as defined in the previous section
n is the sample size.

Steps in Durbin’s h Test

1. Run the OLS regression for the model represented by eq. 6.


2. Find var ( 𝛽̂1 )
3. Compute h
4. Since h follows a standard normal distribution for large samples, we use the normal
distribution to carry out the following hypothesis test.

(i) Test for positive autocorrelation


H0: ρ = 0 versus H1: ρ > 0
Null hypothesis states that there is no positive autocorrelation
(ii) Test for negative autocorrelation
H0: ρ = 0 versus H1: ρ < 0
Null hypothesis states that there is no negative autocorrelation

Limitations of Durbin’s h test


It is not possible to use this test if 𝑛 𝑣𝑎𝑟(𝛽̂1 ) ≥ 1.

3.3 Durbin’s m Test

Durbin (1970) suggested the m test to overcome the limitation of the h test.

Steps in Durbin’s m Test

1. Run the OLS regression for the model represented by eq. 6.

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
2. Obtain 𝑢̂𝑡
3. Run the OLS regression
𝑢̂𝑡 = b1Yt-1 + b2Yt-1 + bp Yt-p +bp+1 X1t +…+ bp+k Xkt + bp+k+1 ût−1 (7)

We use the t test for the coefficient of ût−1 to carry out the following hypotheses test.
(i) Test for positive autocorrelation
H0: ρ = 0 versus H1: ρ > 0
Null hypothesis states that there is no positive autocorrelation
(ii) Test for negative autocorrelation
H0: ρ = 0 versus H1: ρ < 0
Null hypothesis states that there is no negative autocorrelation

4. Tests for Higher Order Autocorrelation

4.1 Wallis Test

Wallis proposed a test for fourth order autocorrelation. If the disturbance term is
characterized by fourth order autocorrelation then,
ut = φ4ut-4 + εt

Hypothesis in Wallis Test


Null Hypothesis
H0: φ4 = 0
Alternate Hypothesis
H1: φ4 <0 Or H1: φ4 >0
Essentially, the null hypothesis states that fourth autocorrelation is not present and the
alternate hypothesis states the converse is true.

Steps in Wallis Test


Wallis proposed a modified d statistic
∑𝑛
𝑡=5(𝑢 ̂𝑡−4 )2
̂𝑡 −𝑢
d4 = ∑𝑛 ̂𝑡2
𝑡=1 𝑢
The test can be used with for
a) A model without intercept which contains dummy variables for quarterly data
b) A model with intercept and without dummy variables for quarterly data.

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
Wallis derived upper and lower bounds for d4. Tables for different significance points have
been derived separately for both these models.

5. Lagrange Multiplier (LM) or Breusch Godfrey Test

This test overcomes two main limitations of the D-W test namely,
(i) It allows the use of both autoregressive and moving averages regression models
(ii) Allows testing for higher order autocorrelation.

Hypothesis in LM Tests
The null hypothesis is that there is no autocorrelation of any order

Alternate hypothesis can be of two types


One, in which ut is generated by the pth order autoregressive AR (p) scheme as follows:
ut = ρ1 ut-1 + ρ2 ut-2 + . . . . . + ρp ut-p + εt
Where, εt ∼ N(0,𝜎𝜀2 ) and cov (εt, εs) = 0, t≠ s
The other, in which ut is generated by the pth order moving average MA (p) scheme as
follows:
ut = ρ1 εt-1 + ρ2 εt-2 + . . . . . + ρp εt-p + εt
Where, εt ∼ N(0,𝜎𝜀2 )
and cov (εt, εs) = 0, t≠ s

Steps in LM test

1. Estimate the model by OLS method and obtain the estimated residuals, 𝑢̂𝑡
2. Run the auxiliary regression
𝑢̂𝑡 = α1 + α2 Xt + 𝜌̂1 𝑢̂𝑡−1 + 𝜌̂2 𝑢̂𝑡−2 + . . . + 𝜌̂𝑛 𝑢̂𝑡−𝑛 + εt3 (8)
3. Obtain R2
4. The test variate is (n-p) R2.
5. For a large value of n, (n-p) R2 ∼ 𝜒𝑝2
6. The hypothesis test is a test of joint significance of first p autocorrelations of these
disturbance terms. H0: ρ1 = ρ2 =. . . . ρn = 0 (No autocorrelation)
H1: At least one of the ρ ≠ 0 (Autocorrelation present)
The same test can be used for any one of the alternate hypotheses.
3
This regression contains only n-p variables.

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
7. If the test statistic exceeds the critical value of χ2 at the chosen level of significance,
then the null hypothesis is rejected.

Advantage of LM test

The test can be used both for autoregressive and moving average autocorrelated
disturbance term in the model.

Limitation of LM test

A limitation of the test is that the length of the lag p cannot be specified a priori. The length
of the lag has to be found by inspecting the t statistics on each lagged residual in the
auxiliary regression.

6. Portmanteau Q Tests

6.1 Box Pierce-Q Test

This test is based on the following Q statistic:


Box Pierce Q= n∑ℎ𝑘=1 𝜌̂𝑘2
Where, n is the total number of observations h is the maximum lag
𝜌̂ is the estimated autocorrelation function (ACF) and it is given as
∑𝑛 ̂𝑡 𝑢
𝑡=𝑘+1 𝑢 ̂𝑡−𝑘
𝜌̂𝑘 = ∑𝑛 ̂𝑡2
𝑡=1 𝑢
𝑢̂𝑡 is the estimated disturbance at tth observation
If residuals are white noise, the Q-statistic follows a χ2 distribution with h degrees of
freedom.

Limitations

It has been found that the Q statistic in Box-Pierce Test performs very well with large
samples but not with small samples.

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
6.2 Ljung Box –Q Test

The Q statistic in Box-Pierce test has been modified so that it performs well in small
samples. It is known as the Ljung Box Q statistic.
̂2
𝜌
Ljung Box Q = n (n+2) ∑ℎ𝑘=1 𝑛−𝑘
𝑘

where, 𝜌̂ , is the same in Box- Pierce Q statistic


h is the number of lags being tested.

If residuals are white noise, the Q statistic follows a χ2 distribution with h degrees of
freedom just like the Box-Pierce Q statistic.

The Q statistic can be applied for any type of ARIMA4 model. But when it is applied to
test for autocorrelation of the disturbance term in a model, the degrees of freedom of the
test statistic have to be computed by subtracting the number of parameters from the total
number of observations.

Hypothesis in Q Tests

The null and alternative hypotheses are the same as those in the Breusch-Godfrey LM test.

Steps in Q test

1. Estimate the model by OLS method and obtain the estimated residuals, 𝑢̂𝑡
2. Estimate the autocorrelation function 𝜌̂
3. Compute the test variate Q
4. Q ∼ 𝜒ℎ2
5. The hypothesis test is a test of joint significance of first p autocorrelations of these
disturbance terms. H0: ρ1 = ρ2 =. . . . ρn = 0 (No autocorrelation)
H1: At least one of the ρ ≠ 0 (Autocorrelation present)
6. If the test statistic exceeds the critical value of χ2 at the chosen level of significance, then
the null hypothesis is rejected.

4
Autoregressive Integrated Moving Averages (ARIMA) model is a generalization of the ARMA
(Autoregressive Moving Averages model.

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION
____________________________________________________________________________________________________
7. Summary

There are several methods for detecting the presence of autocorrelation. The graphical
method and runs method are non-parametric tests. Durbin Watson test and Durbin's m and
h test are parametric tests that can be used for detection of first order autocorrelation. Wallis
test, LM test and Portmanteau tests are used for detection of higher order autocorrelation.
Durbin Watson test is one of the most commonly known test for autocorrelation but it
suffers from some limitations. These limitations are that in some cases the test is
inconclusive. The test can only be used when the regression model has an intercept term
and does not include lagged dependent variables. The test can only be used when the error
term is autoregressive. Durbin's h test helps in testing for autocorrelation in the presence
of lagged dependent variables in the regression model. LM test can be used when the error
term is generated by an autoregressive or moving averages processes.

BUSINESS PAPER No. 8: FUNDAMENTALS OF ECONOMETRICS


ECONOMICS MODULE No. 18: TEST FOR AUTOCORRELATION

You might also like