DETECTION OF AUTOCORRELATION AND HOW TO RESOLVE IT

DETECTION OF AUTOCORRELATION AND HOW TO RESOLVE IT The use of OLS to estimate a regression model leads us to BLUE estimates  o...



DETECTION OF AUTOCORRELATION AND HOW TO RESOLVE IT





The use of OLS to estimate a regression model leads us to BLUE estimates of the parameters only when all the assumptions of the classical linear regression model are satisfied. We will examine effects of OLS estimator when the assumption of serial independence of the error term is violated.
The assumption states that the covariances and correlations between
different disturbances are all zero:
Cov(Uj,Us) =0 for all j ≠ s [1]

This assumption states that error terms are independently distributed, which is called serial independence. Serial independence requires that all disturbance terms are independently
distributed or are not correlated with one another. If the assumption does not hold, then the disturbance are not independent, they are autocorrelated (serially dependent). In this case:
Cov(Uj,Us) ≠0 for all j ≠ s [2]


Which means the error at period j is correlated with the one at period s.

Autocorrelation is most likely to occur in the models that include time series data and it means that either the model is filled with an insufficient number of lagged variables or not all the relevant explanatory variables are specified in the model. The strike in one period will be carried over to the next period and will affect the next period. Serial correlation, serial dependence and autocorrelation are used interchangeably.
The error term catch the influence of the not included variables affecting dependent variable. Persistence effect of the excluded variables causes positive autocorrelation. If those excluded variables are observable and includable in the model, autocorrelation test result is an indication of a misspecification model.
Autocorrelation test is also regarded as misspecification test. Incorrect functional forms(using a linear form instead of quadratic form), omitted variables (Suppose that Y t  is related to X1t  and X2t but we do not include X2t   in our model. The effect of X2t will be captured by the disturbances Ut  If X2t  as many economic time series depends on X2t-1 X2t-2 .and  so on. This leads to a correlation that is impossible to avoid among the Ut,Ut-1,Ut-2 and so on )and an inadequate dynamic specification of the model can cause autocorrelation


CONSEQUENCES 



·         OLS estimates remain unbiased and consistent, but it becomes inefficient. This is because both unbiasedness and consistency do not depend on serial independence which is violated.


·         The standard errors are underestimated, the hypothesis testing procedure becomes invalid  since the estimated standard errors may not be reliable, so t-values are overestimated.


·         High values for the t-statistics and R2  are observed in the estimation output. It means that the result is false if the output is not correctly interpreted.






First order Autocorrelation
The simplest and most popular form of the autocorrelation is the first-order autoregressive process;
Y= A1 + A2X1 + A3X2 + AkXk + Ut [3]
Error term Ut is assumed to depend on its previous(lagged) value as follows;
Ut = p Ut-1 + vt [4]


̀ where p parameter express the functional relationship between error term(Ut) and vt is the new error term with mean zero and constant variance , which exhibits no serial correlation. It means that the value of the error term in any observation is equal to  p times its value in the previous observation plus a new error term. The p is called the first-order autocorrelation coefficient and takes values from -1 to 1(or /p/ <1). If p=0 Ut= vt then there is no residual autocorrelation, error term an iid (identically independently distributed) and the autocorrelation condition is satisfied.
If p approaches unity, the value of the previous observation of the error (Ut-1) becomes more important in determining the value of the current error term (ut) and therefore greater positive serial correlation exists. This is called positive serial correlation.
If p approaches -1, serial correlation will be very
high. This time, we now have negative serial correlation.
In economics, negative serial correlation is less likely to happen.
However,If /p/ <1 then the first autoregressive process is stationary. It means that the mean, variance and covariance of Ut do not change over time.
Vt  satisfies the OLS conditions. The transformation like Ut - ᵨ Ut-1 will generate homoscedastic non autocorrelated errors.

If p=0, there is absence of serial correlation and OLS is BLUE. If p=0, OLS estimator will be confusing because standard errors will be based on the incorrect formula.


There are various autocorrelation tests. All tests have same null hypothesis of absence of autocorrelation in the disturbance term. The tests have different alternative hypothesis because of differences of the order of the autocorrelation.


The existence of autocorrelation may be an indication of misspecification. A possible way to eliminate autocorrelation problem is to change model specification.




H0: no autocorrelation in the error term


H1: Ut= µ1 Ut-12 Ut-2+…+ µpUt-p+ Vt




DETECTION



  1.     GRAPHICAL METHOD
Plotting the error term detect autocorrelation. Plot the residual Ut against time. If a systematic pattern exist, autocorrelation is like to be a problem. Systematic patterns like cyclical, upward linear trend,  downward  linear trend and quadratic trend allows for the suspicion of autocorrelation in the Ut. If there exist no systematic pattern among the errors, then there is no evidence autocorrelation.


APPLICATION 

 The file contains the following monthly data from 1949M01 to 2017M12. The variables included are X and Y and they are stationary at level.

To check for stationarity or non stationarity, see previous post  here  and here. If you are new to Eviews, you can watch videos  on how to  import data files into Eviews here and how to run a regression here.

The workfile is having 852(@first  @last) observation but will be using 576 observation as our sample (1970M01 @last). You can click here to see data. 



The regression below is a simple regression. We estimate in Eviews by typing in the command line :
                                   Ls Y c X
                    Or 
At the   menu bar click VIEW>>ESTIMATE EQUATION.


The regression output shows that a unit increase in X will lead to a decrease in Y by 0.10units. Means that there is a negative relationship between X and Y

To check the graph ,we will create a new series 'e' . Type in the command line :  series e = resid .




Plot the new series by double clicking the new series e and check the graph.


Interpretation:
The graph exhibit a cyclical pattern. This means we have autocorrelation.


2.        THE DURBIN WATSON TEST (1950)


This is the most known statistics test for autocorrelation. This test is used for first order autocorrelation. The test is valid if it meets the following assumptions


1.       The regression model if includes a constant;


2.       Serial correlation is assume to be first order only i.e the errors follow the 1st order autoregressive(AR) scheme


                            Ut = p Ut-1 + vt


3.       The equation does not include lagged of dependent variable as explanatory variable.

Durbin Watson also assumes that error term is stationary and normally distributed with zero mean. It tests the null hypothesis that the errors are uncorrelated.


H0=no autocorrelation


H1= first order autocorrelation

Durbin Watson should be applied if all this condition are satisfied. Otherwise it is more informative to use Breusch-Godfrey test in the research paper.


Durbin Watson test statistics is deined as:


DW=Σ(Ut - Ut-1)2/ΣUt2 = 2(1-p)          [5]


Decision Rule:


P=0, DW=2   no autocorrelation


P>0, DW<2 positive autocorrelation


P<0, DW>2 negative autocorrelation




DW-statistics cannot be tabulated. But it is possible to drive distributions of a lower (dL) and an upper (dU) bound. These two distributions depend on the number of the observations (n) and the number of the explanatory variables (K). Therefore DW–statistics is tabulated as follows:




Reject H0.:Evidence of positive autocorrelation
Zone of indecision
Do not reject H0: no autocorrelation
Zone of indecision
Reject H0.:Evidence of negative autocorrelation


 0                               dl                            du                      2                         4-du                     4-dl                           4


If DW is greater than or equal to du: Do not reject


If dl <DW< du: the test is inconclusive


If DW is less than or equal to dl: reject H0 for the favor of first order autocorrelation.



                                  Number of regressors including intercept
                                K=3                              k=5                               k=7                               k=9
Number of observation
dl
du
dl
du
dl
du
dl
du
25
1.206
1.550
1.038
1.767
0.868
2.012
0.702
2.280
50
1.462
1.628
1.378
1.721
1.291
1.822
1.201
1.930
75
1.571

1.680
1.515
1.739
1.458
1.801
1.399
1.867
100
1.634
1.715
1.592
1.758
1.550
1.803
1.506
1.850
200
1.748
1.789
1.728
1.810
1.707
1.831
1.686
1.852




If there is autocorrelation, OLS is no longer BLUE, then EGLS (Cochrane-Orcutt) method can be used.




DW test has some drawbacks such as;


-The form of model should be known


       -The test is sometimes inconclusive. The inconclusiveness of the DW test comes from the fact that the small sample distribution for the DW statistic depends on the X variables and is difficult to determine.


APPLICATION



Interpretation:
From the regression results output of the previous example (graphical representation) we observe that the DW statistic is equal to 0.14. Finding the values of dl and du for n=576, k=1, at 5% level of significance  and putting those value in DW table ,we have the result 0.14 and therefore there is strong evidence of positive autocorrelation.



3.       THE BOX-PIERCE AND THE LJUNG-BOX TEST (Q test) (1970)
The Ljung Box test (named for Grata M. Ljung and George E.P.Box) is a type of statistical test of whether any group of autocorrelations of a time series are different from zero. It test the overall randomness based on a number of lags, and is therefore a Portmanteau test(wikipedia).
This test is also known Ljung box Q test, and its closely connected to the Box-Pierce test (which is named after George E.P.BOX and David A. Pierce).
The Box-Pierce and the Ljung-Box test have asymptotic ƴ2 distribution, with p degrees of freedom under the null hypothesis of no autocorrelation. This test uses autocorrelation of the residuals. The estimated autocorrelation coefficients are defined as pi ̂ .
Pi ̂=cov(ut,ut-i)/sqrt(var(ut)) . sqrt(var(ut-i)) [6]


The theoretical autocorrelation coefficients p ̂ are zero under the null hypothesis. The Q-test does not look at the individual autocorrelation coefficients. It considers the sum of a number of squared autocorrelation coefficients as follows:
Q=nΣpi=1 pi ̂2        [7]


but this test has low power of detecting autocorrelation. The main difference between Q-test and Breush Godfrey test below is that one specific order of the autoregressive process specified should be chosen under the alternative hypothesis.


APPLICATION
Run the regression of Y on X and get the output as it was given above .
In menu tab of the output click VIEW>>RESIDUAL DIAGNOSTIC>> CORRELOGRAM Q TEST


Specify the lags and since our data series is a monthly series ,we used 12 lags and OK. You can also try 24 lags.



H0: There is no ocorrelation
H1: There is autocorrelation 


You can simply put, if the prob. chi square close to the obs*R-squared is >0.05, we do not  reject the H0 and conclude that the model is not serially correlated. If the prob. chi square close to the obs*R-squared is < 0.05, we reject the H0 and conclude that there is an evidence of serial correlation.

Interpretation:
 At 5% level of significance,we will reject the null hypothesis of no autocorrelation because the prob of the 12th lag is < 0.05 and its significant .Therefore autocorrelation exist


4 .    BREUSCH­-GODFREY LM EST
The DW test has several demerits that make its use unsuitable in various cases.
For example, it is not applicable when a lagged
dependent variable is used, it may give inconclusive results,
and it can't take into account higher orders of serial correlation.
 Breusch (1978) and Godfrey (1978) developed this autocorrelation test. The idea behind the Breusch-Godfrey test is as follows:

  1. Consider the following linear model that is estimated wih OLS
Y=  AO + A1 Xt + A3Zt + Ut   [8]


Errors are computed and following equation is estimated with OLS


Ut = p 1Ut-1 + p 2Ut-2 +…+ ppUp-t + vt      [9]

The Breusch-Godfrey LM test combines these two equations:


Y=  AO + A1 Xt + A3Zt + p 1Ut-1 + p 2Ut-2 +…+ ppUp-t + vt      [10]


The null and the alternative hypotheses are:


H0: P1 = P2 = · · · = Pp = 0 no autocorrelation


H1: at least one of the ps is not zero, thus, serial correlation


Steps for carrying out the test:


Step 1: Run a regression with OLS, get the estimate and obtain Ut.
Step 2: Run the following regression model with the number of lags used (p) being


determined according to the order of serial correlation you are willing to test


Ut = B1Ut-1 + B2Ut-2 +…+ BpUp-t O + µ1 Xt 3Zt +Vt    [11]
Step 3 Compute the LM statistic = (n - p) R2 from the regression run in step 2. If this


LM statistic is bigger than the x2p critical value for a given level of significance,


then we reject the null of serial correlation and conclude that serial correlation


is present. Note that the choice of p is arbitrary. However, the periodicity of


the data (quarterly, monthly, weekly etc.) will often give us a suggestion for


the size of p.




APPLICATION


In Eviews BREUSCH GODFREY test is called the serial correlation LM test.
Run the same regression




In menu tab of the output click VIEW>>RESIDUAL DIAGNOSTIC>> SERIAL CORRELATION LM test.

Specify the lags and since our data series is a monthly series ,we used 12 lags and OK. You can also try 24 lags.











H0: There is no autocorrelation


H1: There is autocorrelation 


You can simply put, if the prob. chi square close to the obs*R-squared is >0.05, we do not  reject the H0 and conclude that the model is not serially correlated. If the prob. chi square close to the obs*R-squared is < 0.05, we reject the H0 and conclude that there is an evidence of serial correlation.

Interpretation:


From the result, we will use the prob. Chi square value since the Chi square critical value is not given. The test statistic is Obs*R-squared =493.2966 and the value of the prob. Chi square of 0.0000 is <0.05 or 5% level of significance. We will reject the H0 of “no autocorrelation. Therefore there is  evidence of of autocorrelation.


THE WAYS TO RESOLVE AUTOCORRELATION PROBLEM



Autocorrelation is mostly of model misspecification. There are three types of model misspecifications such as:
-Find out the relevant omitted variable and include in the model.


- Log transformation can be use to eliminate autocorrelation problem.


-The dynamic or static specification of the model should be decided. Inclusion of the lagged dependent and exogenous variables can eliminate the autocorrelation problem.


APPLICATION

To correct this serial dependence, we will try one transformation (dynamic specific action). Estimate in Eviews by typing in the command line: L's Y c Y(-1) X or in the menu bar  click VIEW>>ESTIMATE EQUATION



and type Y C Y(-1) X

The new regression output shows that Y depend not just on X but on the lag of itself by one period.



To check  the graphical representation of the error, create a new series U by typing in the  command line: series  U=resid  and plot it(like the previous example above).



The graph shows no discernible pattern. Therefore there is no autocorrelation.

To  check for autocorrelation using formal test , we will specify 12 lags both in correlogram Qtest and serial correlation LM test (same as the example above).
For  Q Test, click VIEW>>RESIDUAL DIAGNOSTIC>>CORRELOGRAM Q TEST from the menu bar of the result.


H0: There is no autocorrelation


H1: There is autocorrelation 


You can simply put, if the prob. chi square close to the obs*R-squared is >0.05, we do not  reject the H0 and conclude that the model is not serially correlated. If the prob. chi square close to the obs*R-squared is < 0.05, we reject the H0 and conclude that there is an evidence of serial correlation.

Interpretation:
 At 5% level of significance,we do not reject the null hypothesis of no autocorrelation because the prob of the 12th lag is > 0.05 and its not significant .Therefore autocorrelation does not exist


For  Breush Godfrey test ,click VIEW>>RESIDUAL DIAGNOSTIC>>SERIAL CORRELATION LM TEST from the menu bar of the result.

H0: There is no autocorrelation


H1: There is autocorrelation 


You can simply put, if the prob. chi square close to the obs*R-squared is >0.05, we do not  reject the H0 and conclude that the model is not serially correlated. If the prob. chi square close to the obs*R-squared is <0.05, we do not reject the H0 and conclude that there is an evidence of serial correlation.

Interpretation:


From the result, we will use the prob. Chi square value since the Chi square critical value is not given. The test statistic is Obs*R-squared =9.228670 and the value of the prob. Chi square of 0.6833 is > 0.05 or 5% level of significance. We do not reject the H0 of “no autocorrelation. Therefore there is no autocorrelation. See  data here..




CONCLUSION



The assumption of a classical linear regression model is that the errors should be serially independent. If the assumption is not satisfied, autocorrelation exist in the model. Autocorrelation does not affect the unbiasedness and consistency properties of the OLS estimators but these estimators are no longer efficient. The standard errors are underestimated and it leads to an unreliable high value of the test statistics. Finally, when estimating a time series model ,Breusch Godfrey LM test is preferable.




REFERENCES



Box,G.E.P. & Pierce, D.A. (1970). Distribution of the Autocorrelations in Auotoregressive moving Average Time Series Models. Journal of American Statistical Association 65. p. 1509-1526.


Cochrane, J.H.(2001). Asset Pricing. USA: Princeton University Press.


Dimitrios Asterious & Stephen G.Hal (2007). Applied econometrics: A modern approach. Palgrave Macmillan.


Durbin, J. & Watson, G.S. (1950). Testing for Serial Correlation in Least-Squares Regression Biometrika 37. p.409-428.




Godfrey, L.G. (1978). Testing for Higher Order Serial Correlation in Regression Equations when the Regressors Include Lagged Dependent Variables. Econometrica 46. p.1303-1310.


Ljung, G.M. & Box, G.E.P.(1978). On a measure of Lack of Fit in Time Series. Biometrica 65. p. 297-303.


Uğur ERGÜN & Ali Göksu (2013). Applied Econometrics With Eviews Applications. Sarajevo :


International Burch University. P 90-150.



COMMENTS

Name

ARTICLES,26,Econometrics,19,economics update,45,MACROECONOMICS,9,MICROECONOMICS,2,
ltr
item
LIVE LOVE ECONOMICS: DETECTION OF AUTOCORRELATION AND HOW TO RESOLVE IT
DETECTION OF AUTOCORRELATION AND HOW TO RESOLVE IT
https://4.bp.blogspot.com/-ND3HdhgMwsU/Wmnwws1XpVI/AAAAAAAAAek/NdeJj-eQP8UlgYkGjK2nv9Y69wFP3awhQCLcBGAs/s320/IMG_20180125_155831_152.jpg
https://4.bp.blogspot.com/-ND3HdhgMwsU/Wmnwws1XpVI/AAAAAAAAAek/NdeJj-eQP8UlgYkGjK2nv9Y69wFP3awhQCLcBGAs/s72-c/IMG_20180125_155831_152.jpg
LIVE LOVE ECONOMICS
https://www.liveloveeconomics.com/2018/01/detection-of-autocorrelation-and-how-to.html
https://www.liveloveeconomics.com/
https://www.liveloveeconomics.com/
https://www.liveloveeconomics.com/2018/01/detection-of-autocorrelation-and-how-to.html
true
3384690550831276507
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy