Econ 140 Autocorrelation Lecture 18 Lecture 18 1 Today’s plan Econ 140 • Definition and implications • How to test for first-order autocorrelation • Durbin-Watson test as an introduction to the presence of first-order serial correlation in the model • How to to estimate allowing for autocorrelation: GLS generalized least squares as a means of allowing for nonconstant variance. • Phillips curve as an example: Note, the original Phillips curve has no lagged variables included in it. Consideration of the model: understand wage inflation and unemployment; or just prediction of inflation? Lecture 18 2 Definitions and implications Econ 140 • Autocorrelation is a time-series phenomenon • 1st-order autocorrelation implies that neighboring observations are correlated – the observations aren’t independent draws from the sample Lecture 18 3 Definitions and implications (2) Econ 140 • In terms of the Gauss-Markov (or BLUE) theorem: xt ˆ b ctYt where ct xt2 the model is Yt = a + bXt + et • The model is still linear and unbiased if autocorrelation exists: E bˆ ct a bX t b Lecture 18 4 Definitions and implications (3) Econ 140 • Autocorrelation will affect the variance: V bˆ s t cs ct st • if s = t, then we would have: 2 2 c t • but if s t, and Y observations are not independent, we have nonzero covariance terms: 2s t cs ct st Lecture 18 5 Definitions and implications (4) Econ 140 • Think of a numerical example to demonstrate this • assuming t = 3: if we wanted to estimate b̂ : bˆ c1Y1 c2Y2 c3Y3 ctYt • We want to consider the efficiency, or the variance of b̂ V bˆ 2 ct2 2s t cs ct st – If BLUE: all covariance terms are zero. – If covariance terms are nonzero: we no longer have minimum variance – minimum variance is defined as 2 ct2 Lecture 18 6 Summary of implications Econ 140 1) Estimates are linear and unbiased 2) Estimates are not efficient. We no longer have minimum variance 3) Estimated variances are biased either positively or negatively 4) Unreliable t and F test results 5) Computed variances and standard errors for predictions are biased • Main idea: autocorrelation affects the efficiency of estimators Lecture 18 7 How does autocorrelation occur?Econ 140 Autocorrelation occurs through one of the following avenues: 1) Intertia in economic series through construction – With regards to unemployment this was called hysteresis: this means that certain sections of society who are prone to unemployment 2) Incorrect model specification – There might be missing variables or we might have transformed the model to create correlation across variables (more on this later) Lecture 18 8 How does autocorrelation occur?Econ 140 3) Cobweb phenomenon – agents respond to information with lags 4) Data manipulation – example: constructing annual information based on quarterly data Lecture 18 9 Graphical results Econ 140 • With no autocorrelation in the error term: we would expect all errors to be randomly dispersed around zero within reasonable boundaries • Simply graphing the estimated errors against time indicates the possibility of autocorrelation: – we look for patterns of errors over time – patterns can be positive, negative, or zero • Graph error vs. time, we have positive correlation in the error term – errors from one time period to the next tend to move in 1 direction, with a positive slope Lecture 18 10 Phillips Curve Econ 140 • L_18.xls : Phillips Curve data – Can calculate predicted wage inflation using the observed unemployment rate and the estimated regression coefficients – Can then calculate the estimated error of the regression equation – Can also calculate the error lagged one time period Lecture 18 11 Durbin-Watson statistic Econ 140 • We will use the Durbin-Watson statistic to test for autocorrelation • This is computed by looking over T-1 observations where t = 1, …T eˆt eˆt 1 d T 2 e ˆ t 2 t T t 2 Lecture 18 2 12 Durbin-Watson statistic (2) Econ 140 • The assumptions behind the Durbin-Watson statistic are: 1) You must include an intercept in the regression 2) Values of X are independent and fixed 3) Disturbances, or errors, are generated by: et et 1 v • this says that errors in this time period are correlated with errors in the last time period and some random error vt • is the coefficient of autocorrelation and is bounded -1 1 T • can be calculated as ̂ t 2 eˆt eˆt 1 Lecture 18 T 2 e ˆ t 2 t 13 How to estimate Econ 140 • This estimation matters because it will be used in the model correction • can be estimated by this equation: ˆ 1 d2 • Once we have the Durbin-Watson statistic d, you can obtain an estimate for Lecture 18 14 How to estimate (2) Econ 140 • How the test works: • The values for d range between 0 and 4 with 2 as the midpoint d – using ˆ 1 , d 4 : 2 value d value -1 4 Autocorrelation? Perfect negative autocorrelation 0 2 Zero autocorrelation 1 0 Perfect positive autocorrelation Lecture 18 15 How to estimate (3) Econ 140 • We can represent this in the following figure: indeterminate indeterminate 0 2 4 dL H1 Reject null dU 4-dU 4-dL H0: =0 Cannot reject null H1 Reject null • dL represents the D-W upper bound • dU represents the D-W lower bound • The mirror image of dL and dU are 4- dL and 4-dU Lecture 18 16 Procedure Econ 140 Table on the second handout for today is the Durbin-Watson statistical table and an additional table for this analysis 1) Run model: Yt a bX t et 2) Compute: eˆt Yt Yˆt 3) Compute d statistic 4) Find dL and dU from the tables K’ is the number of parameters minus the constant and T is the number of observations 5) Test to see if autocorrelation is present Lecture 18 17 Example (2) Econ 140 • Returning to L18.xls d 0.331 d L 1.475 K ' 1 observations 47 0.331 0 1.475 dL H1 Reject null Lecture 18 2 4 4-dU 4-dL dU H0: =0 Accept null H1 Reject null 18 Generalized least squares • What can we do about autocorrelation? • Recall that our model is: Yt = a + bXt + et • We also know: et = et-1 + vt Econ 140 (1) • We will have to estimate the model using generalized least squares (GLS) Lecture 18 19 Generalized least squares (2) Econ 140 • Let’s take our model and lag it by one time period: Yt-1 = a + bXt-1 + et-1 • Multiplying by : Yt-1 = a + bXt-1 + et-1 (2) • Subtracting our (2) from (1), we get Yt - Yt-1 = a(1-) + b(Xt-1 - Xt-1) + vt where vt = et - et-1 Lecture 18 20 Generalized least squares (3) Econ 140 • Now we need an estimate of : we can transform the variables such that: where: Yt* a * bX t* et* (3) Yt* Yt Yt 1 • Estimating equation (3) allows us to estimate without firstorder autocorrelation Lecture 18 21 Estimating Econ 140 • There are several approaches • One way is by using a short cut: d ˆ 1 2 thinking back to the Durbin-Watson statistic, 2 e e ˆt ˆt 1 d T 2 e ˆ t 2 t T t 2 we can rewrite the expression for d as: d Lecture 18 T 2 t 2 eˆt T 2 t 2 eˆt 2 T t 2 eˆt eˆt 1 T 2 2 eˆt T 2 t 2 eˆt 1 T 2 t 2 eˆt 22 Estimating (2) Econ 140 • Collecting like terms, we have: 2 2 ̂ d • Solving for , we can get an estimate in terms of d: d ˆ 1 2 • Since earlier we defined as: ̂ T t 2 eˆt eˆt 1 T 2 2 eˆt – we can use this to get a more precise estimate • There are three or four other methods in the text Lecture 18 23