You are on page 1of 14

Econometrics Lecture No.

1 & 2(3
rd
Monthly) Date: 14/09/2012
AUTOCORRELATION
Autocorrelation occurs when Error terms of different times are dependent on each
other i.e. their Covariance is not equal to zero.
Mathematically: (

) (

) (this means that there is the


problem of Autocorrelation).
Autocorrelation mostly occurs in time series data. This is because in time series data,
one event or observation is connected to other or previous through time or lagged
values.
Difference between Autocorrelation and Serial Correlation:
According to Tintner:
Autocorrelation:
Autocorrelation is the lag correlation of a given series with itself, lagged by a number
of time units. Simply its the correlation of a given series with a series of its own
lagged values.
Example: if we have a series


And another series making the first one as series of lagged values, lagging by time
period of one i.e.
11 3 2
........ ,......... , c c c ,. Correlation between such series is called
Autocorrelation.
Serial Correlation:
Serial Correlation is the lag correlation between the error terms of two different series.
Example:
If we have a series
10 2 , 1
.......... .......... c c c and another series comprising of the error
terms
11 3 2
........ ,......... , u u u where these two are two different series, then the
correlation among them is called Serial Correlation.
Structure of Autocorrelation:
1. First order Autocorrelation:
It assumes the first order Autoregressive process and is denoted by AR (1).
This model assumes that the error term for period-t (Current period) is
correlated with the error term for period (t 1) (Previous period).
Example:
If we have an income-consumption function then the linear regression model
assuming AR (1) process will be like:
t t t
c | o + X + = Y
Where t=1 10

Where 1 < < 1


The second equation tells us that the disturbance in period t (current period)
depends upon the disturbance in period t-1 (previous period) plus some
additional amount

, which is an error.
The parameter is called the first-order autocorrelation coefficient and
can be interpreted as the correlation coefficient between

and

.
If then the disturbances in period t are positively correlated with the
disturbances in period t-1. In this case there is positive autocorrelation.
This means that when disturbances in period t-1 are positive disturbances,
then disturbances in period t tend to be positive. When disturbances in
period t-1 are negative disturbances, then disturbances in period t tend to
be negative. Time-series data sets in economics are usually characterized by
positive autocorrelation.
If then the disturbances in period t are negatively correlated with
the disturbances in period t-1. In this case there is Negative autocorrelation.
This means that when disturbances in period t-1 are positive disturbances,
then disturbances in period t tend to be negative. When disturbances in
period t-1 are negative disturbances, then disturbances in period t tend to
be positive.
2. Second-Order Autocorrelation:
An alternative model of autocorrelation is called the second-order
autoregressive process or AR(2). The AR(2) model of autocorrelation
assumes that the disturbance in period t is related to both the disturbance in
period t-1 and the disturbance in period t-2. The general linear regression
model that assumes an AR(2) process is given by:
t t t
c | o + X + = Y


The second equation tells us that the disturbance in period t depends upon
the disturbance in period t-1, the disturbance in period t-2 and some
additional amount, which is an error.
3. th-Order Autocorrelation:
The general linear regression model that assumes a th-order autoregressive
process or AR(), where can assume any positive value and is given by:
t t t
c | o + X + = Y


Sources of Autocorrelation:
1. Omitted explanatory variable:
If we exclude an independent variable that can affect our model, then the
effect of that variable results in increase of the error term. Such a case is called
Excluded variable specification bias and the inclusion of such variable
mostly removes the autocorrelation.
Example:
If we have a model:


Where:


Now if we exclude the variable

then the model will become like:


Where:


Which means that the error

will show a systematic pattern to the extent


up to which

(Dividend) is affected by the variable

, thus causing
a false Autocorrelation.
2. Misspecification of mathematical form:
It refers to using of an incorrect functional form i.e. using linear form instead
of quadratic and vice versa.
Example:
Considering the above dividend equation, if we take its original form as:


But instead of that we fit the regression line as:


Then the error term

will give a systematic pattern of the effect of the


square of output thus causing Autocorrelation. The graph of this linear
function will overestimate the amount of dividend at some point and will also
underestimate it at some point. This is because the true graph will give a
curved pattern.
3. Manipulation in statistical data:
a. Interpolation:
When there is a value missing within or in the middle of a series and we
place a proxy like average for that, this is called interpolation of data.
Example:
If we have annual interest rate and we want to find it on monthly basis and
we divide that rate at 12-months. We will get the monthly value of
interest rate but the fluctuations will be missing as by doing so we will
assign same rate to each month but the actual situation can be different i.e.
there can be more interest rates for some months and less for others and
this will contribute to Autocorrelation.
b. Extrapolation:
When some data at the extreme ends of a series is missing and we want to
put proxies for that, its called Extrapolation of data.
4. Misspecification of true random error:
It means assuming about the error terms without checking them for
dependency i.e. just assuming without carrying out any statistical test for
checking dependency.
Detection of Autocorrelation:
Autocorrelation can be detected through the following methods:
1. Graphical method:
In this method we make a time series plot of residuals i.e. Plot the residuals
against time by taking residuals at y-axis and time at x-axis.
If the plot shows a systematic pattern then the error terms of different times
are dependent upon each other and therefore autocorrelation exist.
If the plot doesnt show a systematic pattern then the error terms are
independent of each other and thus there is no autocorrelation problem.
2. Plotting residuals against their lagged values:
Lagged values means previous values so if we plot residuals against their
lagged values, it will give the same concept as that of above and is interpreted
in the same way as above.
3. Residual Correlerogram:
Autocorrelation can also be detected if we plot the residuals lagged values
against their respective covariance by taking lagged values at x-axis and their
covariance at y-axis.
If the dots in the plot are near to origin then there is no autocorrelation.
Note: Relationship of the variance of a variable with its lagged value is
called Autocorrelation.


In the above diagram, figure a.d shows a systematic pattern hence
showing that there is autocorrelation but figure e doesnt show any
systematic pattern hence qualifying for no autocorrelation.
4. Durbin-Watson d test:
The most often used test for first-order. It is important to note that this test can
only be used to test for first-order autocorrelation, it cannot be used to test
for higher-order autocorrelation. Also this test cannot be used if the lagged
value of the dependent variable is included as a right-hand side variable i.e. as
an independent variable and it can have value from 0 to 4
The formula for test is:


Or

Where:



Note: The numerator consist of n 1 observations. This is because one
observation is lost in taking successive differences i.e. for the first value in
data set, there is no value of

and so as there will be no square of the


differences for the first value.
Furthermore this test is based on the estimated values of error i.e. the
residuals.

Assumptions for Durbin-Watson d test:
a. The regression model should include the intercept term because its
essential to obtain the numerator portion of the formula.
b. The explanatory variables should be non stochastic or fixed in repeated
sampling.
c. The error terms should be generated by first-order autoregressive model.
d. The error term is assumed to be normally distributed.
e. The regression model should not include lagged value of the dependent
variable as one of the independent variables like:


Here

is the lagged value of the dependent variable. Therefore this


test cant be applied to it.
f. There should be no missing observations in the data.



Example:
If we have a series of data for the years 2001 to 2012 and in between that
series, data for 2005 to 2008 is missing, this test will not be applicable to
that series or data.
Interpretation for Durbin-Watson test:
As it can have value from 0 to 4 therefore it can be interpreted as:
If:
a. D= 0, It means that and there will be positive Autocorrelation.
If then:

b. D=4, it means that and there will be negative autocorrelation.
If then:

c. D=2, it means that and there will be no autocorrelation.
If then:

Hypothesis testing through Durbin-Watson test:
Following steps are to be followed for hypothesis testing:
1. Stating the hypothesis:
a. If we are performing a two tail test then null and alternative hypothesis
will be:


b. If we are performing one tail test then:


It will be one tail test for positive autocorrelation.
c. For negative autocorrelation, one tail test will have hypotheses as:


2. Choosing the significance level i.e. alpha
3. Choosing the test statistic i.e. Durbin-Watson d test
4. Calculations for test statistic.
5. Locating the critical region as:
a. First part is to get the tabulated value of Durbin-Watson test from table
as:
In the table:
K represents the number of independent variables
For different significance levels, there are different tables
In the required table see against number of observations n and for
the required value of k, the values of d
u
and d
l
.
Where these are the upper and lower limits of Durbin-Watson for the
required significance level and k number of independent variables.
b. Then compare these values with the calculated values of d as:
a. If

or

then reject the null hypothesis


b. If

lies between

and

then accept the null


hypothesis.
c. Area form

and

is called no
conclusion area or inconclusive area.
d. There is also a rule of thumb that is sometimes used to conclude
that there is no first-order autocorrelation if the d statistic is
between 1.5 and 2.5. A d statistic below 1.5 indicates positive
first-order autocorrelation. A d statistic of greater than 2.5
indicates negative first-order autocorrelation. However, strictly
speaking, this is not correct.
6. Making the decision according to the conditions and calculations.

Above discussion in the form of diagram:

Example for Hypothesis testing through Durbin-Watson d test:
1. Our null and alternative hypothesis are:


Because we are performing a two tail test therefore we have set the hypotheses
as above.
2. Significance level is
3. The test statistic used is the Durbin-Watson test.


Or

Where:


4. Calculations for test statistic:
Given in the Supported Excel File (Sheet1)
5. Critical region (Also given in the Excel File, Sheet1)
6. Taking decision about correlation whether it is there or not.
Given in supported Excel File (Sheet1)
How to find value of Durbin-Watson in Gretl:
Following are the steps to get the value of Durbin-Watson in Gretl:
1. Open the gretl software with Guajarati installed if test is to be run at some
table of this book. In my case, I have run test on table: 6.3 of Guajaratis
book.
2. Click the File menu and select the table from the required book.
3. Then go to Model menu and click at OLS in that menu, a window will
appear where you have to specify the dependent and independent variables
for the software.
4. Put Y
1
into the dependent variable box and X into the independent
variable box.
5. Click ok in that window and you will get the value of Durbin-Watson
for the required data in the table chosen, at the end of gretl windows
values.
6. You can save the residual from this model by clicking at residuals in the
menu Save

5. BG-Test (Breusch godfrey test):
Its also called LM-test and is used to overcome the drawbacks of the Durbin-
Watson test.
Unlike the DW test, its used for models having:
a. More than one lagged values
b. Lagged values of the dependent variable as independent variables
c. Independent variable(X) also as a regressor along with the lagged values
of the dependent variable i.e. the residual for time-t.
If we have a two variable model like

and the error


term

follows an AR(P) regression scheme as:


Then the null hypothesis to be tested will be:



Steps for BG-Test:
1. Estimate the original equation by OLS, meaning that estimate the values of
and through OLS method for the estimation of the residual

.
2. Regress

on the original independent variable or variables if there


more than one and on the lagged values i.e.

.
This regression will simply take the form like:


Note: if we have P=4, it will mean that we have to put four lagged values in
the model to be regressed for residuals and to run the regression we will have
observations.
3. Obtain

from the above model as:


4. If the sample size is large then

, i.e. asymptotically this


value follow the chi square distribution with p degrees of freedom.
5. In order to make decision with BG test about Hypothesis, following rules
should be kept in mind:
a. If

then reject the null Hypothesis, i.e. there will be


autocorrelation in it.
Note: Here

and



How to run BG test in Gretl:
Following are the steps for running BG test in gretl:
1. Open Gretl software and select a table from Guajarati through the
following path:
File open data sample file click Guajarati table 6.3
(in this case)
2. A new window with dependent and independent variables will come on
the screen. then follow the path:
Model OLS
A new window will appear where you have to assign dependent and
independent variables to their respective columns as:
Shift Y to dependent variable column and X to independent variable
column.
3. Then click ok, you will get Durbin-Watson value. Then click on the
menu save and then on sub menu residuals and save them as residual
as uhat 1.
4. Then close that window and go to models again, then to OLS and you
will find a residual named uhat1 at the bottom, shift that one to the
dependent variable column.
5. Then go the Tab Lags given at the bottom of the same window and then
check the box for lags of dependent variable and then increase the lags
up to three.
6. Then click ok and gretl will give you the results.
Note: Taking X along with the lagged values depends on ones own taste.
How to interpret the results of BG test:
See from Excel file where all values are given (shhet2)
6. Alternative test:
In Alternative test we use only T-test and Z-test for finding correlation
between residuals and their lagged values and also here we study this
relationship of residual with each of its lagged value separately. Formula for
the T-test will be:


And the Null and Alternative hypothesis will be:

and


I.e. we have to test correlation for both residuals separately during alternative
test for AR (2) model.
For example:
If we have residual equations like this:


Here we can find the correlation between

and

very easily even


through Durbin-Watson, as its an AR (1) model but if we have the equation
like:


Then using alternative test we will have to determine the correlation between

and

separately. This will enable us to know that which


lagged value contributes more towards the Autocorrelation.
In gretl just take each lagged value one by one with the residual uhat-I, i.e.
in the Tab Lags take lags form 1 to 1 and it will give you the separate
results for each lagged value.
Comparison of Durbin-Watson, BG, and Alternative tests:
Durbin-Watson test is used for detecting Autocorrelation in AR (1) model whereas
BG-test and Alternative test can do that in AR (P) models too. In turn the main
difference between BG-test and Alternative test is that BG-test gives the combine
results for correlation in AR (p) models where we cant have the information that
which lag is contributing more towards the autocorrelation where as Alternative
test, tests the correlation of every lag separately, hence giving a complete picture of
every lag and its contribution towards the autocorrelation separately. So we can
find out which lag has the most contribution towards autocorrelation.
Remedies for Autocorrelation:
If the true model of the data generation process is characterized by autocorrelation,
then the best linear unbiased estimator (BLUE) is the Generalized least squares
(GLS) estimator.
Deriving the GLS Estimator for a General Linear Regression Model with First-
Order Autocorrelation:
Suppose we have a general linear regression model as:

...I where t=1,.., n


And

...II
Now to derive the GLS-estimator we will:
a. Derive a transformed model that satisfies all the assumptions of Classical
linear regression model (CLRM) as:
i. Substitute equation II in I we get:

..III
ii. Now in order to eliminate autocorrelation, we will have to eliminate
the term

only because the error term

satisfies all the


assumptions of a CLRM including the assumption of no
autocorrelation.
In order to eliminate

from the equation, we know that the


original equation i.e. equation-I must be satisfied for every single
observation. Therefore it must also be satisfied for time period t 1
as well as for period t. so in case of period t 1 we can write the
equation-I as:

IV
i.e. we have lagged the equation by one time period. Now solving
equation-IV for

we will get:


Now multiplying both sides of this equation we get:

V
Substituting the value of

in equation-III we get:


This equation can also be written as: (re-arranging the equation)


Now if we say that:


Then the above equation will become as:

.A
This is the transformed model.

Note:
a. Slope of coefficient of transformed model is same as slope of
coefficient of the original model.
b. The constant term of the original model will be:



c.

in transformed model satisfies all the assumptions of CLRM.


iii. Now when we run the regression at equation-A, using OLS estimators
we can find out direct estimate of as:


iv. We can also find the value of

as:


v. From this we can find value of

as well:



But these estimates are not GLS and thus are not BLUE because while
computing

and

we lost one observation as we lagged the


original model by one time period. So we have these values for n 1
observations.
But the observation n=1 can be preserved as:


And on the basis of this observation, again create transformed
variables

and

.
vi. Now regress

on constant, transformed variable

and n
observations.
vii. Resulting values from this regression will be GLS and will be BLUE.

Problems with Using the GLS Estimator:
The major problem with the GLS estimator is that to use it you must know the
true autocorrelation coefficient . If you dont the value of , then you
cant create the transformed variables

and

. However, the true


value of is almost always unknown and unobservable. Thus, the GLS is
not a feasible estimator.
In order to remove this drawback we use Feasible Generalized least square
estimate.

Feasible Generalized Least Squares (FGLS) Estimator:
The GLS estimator requires that we know the value of . To make the GLS
estimator feasible, we can use the sample data to obtain an estimate of . When we
do this, we have a different estimator. This estimator is called the Feasible
Generalized Least Squares Estimator, or FGLS estimator.
The two most often used FGLS estimators are:
1. Cochrane-Orcutt estimator
2. Hildreth-Lu estimator
Cochrane-Orcutt Estimator:
To obtain FGLS estimates of o and | using the Cochrane-Orcutt estimator,
following are the steps to be followed:
1. Regress

on a constant and

using the OLS estimator i.e. estimate


model using OLS method, model like:

I
2. Calculate the residuals from this regression i.e. the values of

or

.
3. Regress

on

using the OLS estimator i.e. run the following


regression:



This will yield an estimate of , denoted
.
but do not include a constant
term in this regression.
4. Use the estimate of to create the transformed variables

and

which are parts of the


generalized difference equation:



Which can also b written as:


5. Now get the values of

and from this model through OLS method


(as above) and then also the value of

and put them in the original model-


I to get new residuals.
6. Using these set of residuals, again start from step-3 and repeat the steps up
to step-5
7. Continue repeating steps from step-3 to step-5 until the estimate of i.e.
from two successive iterations differs by no more than some small
predetermined value, such as 0.001.
8. Use the final estimate of to get the final estimates of o and |.

You might also like