0% found this document useful (0 votes)
33 views

Eco 401 Econometrics: SI 2021, Week 9, 9 November 2021

The document discusses autocorrelation in regression models. It begins by defining autocorrelation and explaining how it violates the Gauss-Markov assumptions. It then discusses how autocorrelation can be detected through residual plots, auxiliary regressions, and the Durbin-Watson test. An example using data on ice cream consumption is presented to illustrate these concepts. Autocorrelation is found in the example, suggesting the model is misspecified. Including a lagged variable is proposed as an alternative specification.

Uploaded by

Jerry ma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Eco 401 Econometrics: SI 2021, Week 9, 9 November 2021

The document discusses autocorrelation in regression models. It begins by defining autocorrelation and explaining how it violates the Gauss-Markov assumptions. It then discusses how autocorrelation can be detected through residual plots, auxiliary regressions, and the Durbin-Watson test. An example using data on ice cream consumption is presented to illustrate these concepts. Autocorrelation is found in the example, suggesting the model is misspecified. Including a lagged variable is proposed as an alternative specification.

Uploaded by

Jerry ma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Eco 401 Econometrics

SI 2021,Week 9, 9 November 2021

Autocorrelation

Dr Syed Kanwar Abbas


Office Location: BS304
Email: [email protected]
Agenda
After Heteroskedasticity, our objective is Autocorrelation today. At the end of this session, you should
be able to understand:

What is the Autocorrelation problem?


How does Autocorrelation affect OLS estimates?
How do you formally detect/test Autocorrelation?
How do you correct/solve Autocorrelation?

This lecture is based on Chapter 4 of your textbook by Verbeek (2017).


Autocorrelation
Gauss-Markov assumptions
What does BLUE mean?
• Best – minimum variance of the estimator
• Linear – within the class of linear estimators
• Unbiased – the expected value = 'truth': 𝐸 𝒃 = 𝜷
• Estimator
When is OLS BLUE? Under the Gauss Markov assumptions:
• (A1) mean zero; error terms have mean zero: 𝐸 𝜺 = 𝟎
• (A2) independent; error terms independent of exogenous variables
• (A3) homoskedasticity; error terms have same variance 𝑉 𝜀! = 𝜎 "
• (A4) no autocorrelation; error terms mutually uncorrelated 𝑐𝑜𝑣 𝜀! , 𝜀# = 0, 𝑓𝑜𝑟 𝑖 ≠ 𝑗
§ So what happens if (A4) is violated?
o if error terms mutually correlated 𝑐𝑜𝑣 𝜀! , 𝜀" ≠
0, 𝑓𝑜𝑟 𝑖 ≠ 𝑗

o If 𝑉 𝜀! ≠ 𝜎 # ,it is called heteroskedasticity


Violation 2: Autocorrelation

Autocorrelation (serial correlation) refers to the correlation of a time series with


its own past and future values
Autocorrelation arises if different error terms are correlated; in this case the
covariances between error terms are not all equal to 0
This mostly occurs with time-series data, where the error terms of one or more
consecutive periods are correlated
It also occurs in panel data; where the data set contains repeated observations on
the same individuals, one can expect the different error terms of an individual
to be correlated
The error term picks up the influence of those (many) variables and factors not
included in the model
When can we expect autocorrelation?

Unobservables (model imperfections) from one period partly carry over to the next
period (recall: error term captures all unobservable factors affecting the
dependent variable that the model has not accounted for)
Seasonal patterns
Model is based on overlapping samples
Model is otherwise mis-specified (omitted variable, incorrect functional forms,
incorrect dynamics, and so on)
Consequences of autocorrelation similar to heteroskedasticity
as long as 𝐸 𝜺 𝑿 = 𝐸 𝜺 = 𝟎 holds the OLS estimator is still unbiased, but with
autocorrelation:
o OLS is no longer BLUE
o Routinely computed standard errors are incorrect
Violation 2: autocorrelation

Thus, autocorrelation may be an indication of a misspecified model


(omitted variables, incorrect functional forms, incorrect dynamic
specification)
Accordingly, autocorrelation tests are often interpreted as
misspecification tests
In time series, we shall index the observations by 𝑡 = 1, . . , 𝑇 rather than
𝑖 = 1, . . , 𝑁
Let us look at some graphs
Residual plot
Violation 2: autocorrelation

fitted on basis of
income & price

• Ice cream consumption against time


• Demand for ice cream explained from income and price index
• Clearly, positive and negative residuals group together
• Business cycle movements may have similar effects
Asymptotic test (first-order autocorrelation)
First-order autocorrelation; AR(1)

Many forms of autocorrelation exist. The most popular one is first-


order autocorrelation
Consider 𝑦! = 𝒙"! 𝜷 + 𝜀! ; assume the error term depends upon its
predecessor as 𝜀! = 𝜌𝜀!#$ + 𝜐! , where 𝜐! is an error term with mean
zero and constant variance
This assumes that the value of the error term in any observation is equal
to 𝜌 times its value in the previous observation plus a fresh
component 𝜐!
The parameter 𝜌 and the variance of 𝜐! are typically unknown and along
with 𝜷 we may wish to estimate these
Asymptotic test (first-order autocorrelation)

The auxiliary regression (regressing residual on lagged residual) producing 𝜌5 also


provides a standard error to it, which can be used for testing (if there are no
lagged dependent variables)
It can be shown that 𝑡 ≈ 𝑇𝜌, 5 which provides an alternative way of computing the
test statistic
We test the null (no autocorrelation) against the alternative of non-zero
autocorrelation if 𝑡 > 1.96, for 95% confidence
Asymptotic test (first-order autocorrelation)

Another test (special case of Breusch-Godfrey test) is based on (𝑇 − 1)𝑅" of the


auxiliary regression, to be compared with Chi-square distribution with 1 DF (reject
if > 3.86)
Remark 1: if the model contains lagged values of dependent variable 𝑦$ (or other
explanatory variables that may be correlated with lagged error terms) the auxiliary
regression should include all 𝒙$
Remark 2: if we also suspect heteroskedasticity, White standard errors may be used in
the auxiliary regression
Durbin-Watson test (first-order autocorrelation)
Durbin-Watson test (first-order autocorrelation)

This is a very popular test, routinely computed by most regression packages


Assumptions required for the Durbin-Watson test:
o intercept included in the model, and
o assumption A2 holds; error terms and all explanatory variables are independent,
(so this test is not applicable if the model contains a lagged dependent
variable!)
∑$
!"# &! '&!%&
#
The Durbin Watson test statistic is equal to 𝑑𝑤 = ∑$ #
!"& &!

which is approximately equal to 𝑑𝑤 ≈ 2 1 − 𝜌5


o The approximation sign is due to small differences in the observations over
which the summations are taken.
Durbin-Watson test (first-order autocorrelation)

In general, therefore:
o dw values close to 2 are fine
o dw values close to 0 imply positive autocorrelation
o dw values close to 4 imply negative autocorrelation
The exact critical value 𝑑!"#$ is unknown, but lower and upper bounds 𝑑% and 𝑑& can be derived (see
Table 4.8)

Thus (to test for positive autocorrelation):


o 𝑑𝑤 < 𝑑% ; test statistic is less than lower bound: reject the null; this means the error terms are
positively autocorrelated
o 𝑑𝑤 > 𝑑& ; test statistic is larger than upper bound: do not reject the null; this means the error
terms are not positively correlated
o 𝑑% < 𝑑𝑤 < 𝑑& ; test statistic is in between: inconclusive
The inconclusive region becomes smaller if 𝑇 increases
Demand for ice cream-Example
Demand for ice cream

Based on classic article Hildreth and Lu (1960), using a time-series


of 30 four-weekly observations from 18 March 1951- 11 July
1953
The variables are:
cons: consumption of ice cream per head (in pints)
income: average family income per week (in USD)
price: price of ice cream (per pint)
temp: average temperature (in Fahrenheit)
Demand for ice cream

As expected, the temperature is an important determinant for the


demand for ice cream
Demand for ice cream

The coefficients of estimates have expected signs with income and temperature being significant
For (T=30, K=4); dL = 1.21 and dU = 1.65, against dw of 1.0212
This implies that the null hypothesis should be rejected, which suggests that the model suffers from
positive autocorrelation
Demand for ice cream
Actual and
fitted values

fitted on basis of
income, price &
temperature

The positive (negative) values for the error term are more likely to be followed by positive (negative)
values.
The inclusion of temperature in the model is insufficient to capture the seasonal fluctuation in ice cream
consumption (compared to fig 4.2 with no temperature)
Demand for ice cream

Estimating rho and asymptotic test


Regressing the OLS residuals upon their lag gives
𝜌5 = 0.401; 𝑡 = 2.19; and 𝑅" = 0.149
This gives a Breusch-Godfrey test statistic equal to 𝑇 − 1 𝑅" = 29×0.149 = 4.32
Both the t-test and the Breusch-Godfrey test reject the null of no autocorrelation at the
5% level (𝑡 = 1.96 and Chi-square with 1 df is 3.84 are the critical values)
These rejections imply that OLS is no longer “best” for 𝛽 and that the estimated
standard errors are not correct
(the alternative way of calculating the t-test, based on 𝑡 ≈ 𝑇𝜌5 gives 𝑇𝜌5 =
30×0.401 = 2.20, which also rejects null)
We continue with EGLS and by changing model specification
Demand for ice cream

Starred statistics are for the transformed model and are not directly comparable with their equivalents in
Table 4.9
Same for Durbin- Watson test
The only confirmation from these results is that income and temperature are important determinants
Alternative model
Alternative model

• The finding of autocorrelation may be an indication that there is


something wrong with the model, like the functional form or the dynamic
specification
• A possible way is to change the specification of the model
• One idea is to include one or more lagged variables in the model
• In the ice cream case, we can include, for example, the lagged
temperature in an extended model
• Compared to Table 4.9, the Durbin-Watson test statistic improves to
1.58; it is now in the inconclusive region (1.14- 1.74); since it is fairly
close to the upper bound, we may choose not to reject the null hypothesis
Alternative model

Lagged temperature has a significant negative effect on ice cream consumption


whereas the current temperature has positive effect
.
This indicates an increase in demand when the temperature rises and reduced
expenditures one period later
How to correct for autocorrelation?
Heteroskedasticity & Autocorrelation Consistent–HAC standard errors
Heteroskedasticity & Autocorrelation Consistent–HAC standard errors
Similar to the robust standard errors for heteroskedasticity, it is also possible to correct
OLS standard errors for heteroskedasticity and autocorrelation
This is also referred to as Newey–West standard errors
The White robust standard errors are a special case of HAC
HAC standard errors for OLS estimators are consistent even if the regression errors are
heteroskedastic and autocorrelated
It is appropriate to use if the autocorrelation is restricted to a maximum number of lags
(moving average)
This number of lags can usually be chosen by the researcher
What to do?
In many cases the finding of autocorrelation is an indication that the model is
misspecified
o if this is the case, the most natural route is not to change your estimator (from
OLS to EGLS) but to change the model
Responses in preferred order:
1. Reconsider the model:
1a: change the functional form (use log 𝑥 rather than 𝑥, for example)
1b: extend the model by including additional explanatory variables (seasonals)
or additional lags
2. Compute Heteroskedasticity & Autocorrelation Consistent (HAC ) standard errors
for the OLS estimator
3. Reconsider options 1 and 2; if you are sure:
4. Use EGLS with the existing model
What to do?

Dynamic model (part of 'reconsider the model')


Consider the model 𝑦! = 𝒙"! 𝜷 + 𝜀!
This describes 𝐸 𝑦! 𝒙! = 𝒙"! 𝜷, even if 𝜀! = 𝜌𝜀!#$ + 𝜐!
In the latter case, however, we also have
𝐸 𝑦! 𝒙! , 𝒙!#$ , 𝑦!#$ = 𝒙"! 𝜷 + 𝜌 𝑦!#$ − 𝒙"!#$ 𝜷
Accordingly, we can also write the linear model
𝑦! = 𝒙"! 𝜷 + 𝜌𝑦!#$ − 𝜌𝒙"!#$ 𝜷 + 𝜐!
Where the error term does not exhibit serial correlation; in many cases,
including lagged values of 𝑦 and/or 𝒙 will eliminate the serial
correlation problem
Transformation

Since 𝜐$ satisfies the Gauss-Markov conditions, a transformation like 𝜀$ − 𝜌𝜀$'( generates homoskedastic
non-autocorrelated errors
To transform the model such that it satisfies the Gauss-Markov conditions we thus use
o 𝑦$ − 𝜌𝑦$'( = 𝒙$ − 𝜌𝒙$'( ′𝜷 + 𝜐$ , for 𝑡 = 2, . . , 𝑇
With known 𝜌 this produces (almost) the GLS estimator.
o note: first observation is lost by this transformation (with large # of observations, the loss of a
single observation will have small impact)
o Salvage first observation by multiplying with (1 − 𝜌) )*.,
However, typically 𝜌 is unknown, so estimate it:
First estimate the original model by OLS, gives the OLS residuals
From 𝜀$ − 𝜌𝜀$'( it seems natural to estimate 𝜌 by regressing the OLS residual 𝑒$ upon its lag 𝑒$'(
o this gives 𝜌< = ∑.$-) 𝑒$'( ) '( ∑.$-) 𝑒$ 𝑒$'(
Further readings
You should go through the hand-out as uploaded on LMO. This covers both Heteroskedasticity
and auto-correlation.
The End
Appendix
First-order autocorrelation; AR(1)

The statistical properties of 𝜐$ are the same as those assumed for the error term in
the standard case
Therefore, if 𝜌 = 0, then 𝜀$ = 𝜐$ and the standard Gauss-Markov conditions are
satisfied
To derive the covariance matrix of the error term vector 𝜺 we need to make an
assumption about the initial period error 𝜀(
It is assumed that 𝜀( is mean zero with same variance as other 𝜀$ s
This is consistent with the idea that the process has been operating for a long
period in the past and that the absolute value of 𝜌 is less than one: 𝜌 < 1
Stationarity
To determine the properties of 𝜀$ we now assume 𝜌 < 1

We then say that the first-order autoregressive process is stationary


o A stationary process is such that mean, variance and covariance of 𝜀$ do not change over time
(if the future is like the past, then the historical relationships can be used to forecast the future;
called stationarity)
o If we take any collection of random variables in the sequence and then shift that sequence
ahead any time period, the joint probability distribution must remain unchanged
If 𝜌 = 1 or 𝜌 > 1, the variance becomes infinite and the process is non-stationary
By assuming stationarity, it holds that
o 𝐸 𝜀$ = 0 and
o 𝑉 𝜀$ = 𝑉 𝜌𝜀$'( + 𝜐$ = 𝜌) 𝑉 𝜀$'( + 𝜎/ )
) 1! "
• The variance of 𝜀$ is thus given by: 𝜎0 = 𝑉 𝜀$ =
('2"
Stationarity

Furthermore, the covariance between error terms one period apart is


)' #
cov 𝜀$ , 𝜀$'( = 𝐸 𝜀$ 𝜀$'( = 𝜌 ('*#
The covariance between error terms two periods apart is
" )' #
𝐸 𝜀$ 𝜀$'" = 𝜌 ('*#

+ )' #
In general, we have (for non-negative integers s): 𝐸 𝜀$ 𝜀$'+ = 𝜌
('*#
Thus, this type of autocorrelation implies that all error terms are correlated; the
covariance decreases if the distance in time gets larger (if s gets large) since 0 <
𝜌 <1

You might also like