1 Autocorrelation The Nature of Autocorrelation 2 The

  • Slides: 28
Download presentation
1 Autocorrelation

1 Autocorrelation

The Nature of Autocorrelation 2 Ø The randomness of the sample implies that the

The Nature of Autocorrelation 2 Ø The randomness of the sample implies that the error terms for different observations will be uncorrelated. Ø When we have time-series data, where the observations follow a natural ordering through time, there is always a possibility that successive errors will be correlated with each other. Ø In any one period, the current error term contains not only the effects of current shocks but also the carryover from previous shocks. This carryover will be related to, or correlated with, the effects of the earlier shocks. When circumstances such as these lead to error terms that are correlated, we say that autocorrelation exists. Ø The possibility of autocorrelation should always be entertained when we are dealing with time-series data.

3 ØFor efficiency (accurate estimation / prediction) all systematic information needs to be incorporated

3 ØFor efficiency (accurate estimation / prediction) all systematic information needs to be incorporated into the regression model. ØAutocorrelation is a systematic pattern in the errors that can be either attracting (positive) or repelling (negative) autocorrelation.

Postive Auto. No Auto. Negative Auto. 4 crosses line not enough (attracting) et 0

Postive Auto. No Auto. Negative Auto. 4 crosses line not enough (attracting) et 0 . . crosses line randomly t . . . . t. crosses line too much (repelling). . . t. . .

Regression Model 5 yt = 1 + 2 xt + et zero mean: E(et)

Regression Model 5 yt = 1 + 2 xt + et zero mean: E(et) = 0 homoskedasticity: var(et) = 2 nonautocorrelation: cov(et, es) = t = s

Order of Autocorrelation 6 yt = 1 + 2 xt + et 1 st

Order of Autocorrelation 6 yt = 1 + 2 xt + et 1 st Order: et = et 1 + t 2 nd Order: et = 1 et 1 + 2 et 2 + t 3 rd Order: et = 1 et 1 + 2 et 2 + 3 et 3 + t We will assume First Order Autocorrelation: AR(1) : et = et 1 + t

First Order Autocorrelation 7 yt = 1 + 2 xt + et et =

First Order Autocorrelation 7 yt = 1 + 2 xt + et et = et 1 + t E( t) = 0 where 1 < < 1 var( t) = 2 cov( t, s) = t = s These assumptions about t imply the following about et : E(et) = 0 2 var(et) = e 2 = 2 1 cov(et, et k) = e 2 k for k>0 corr(et, et k) = k for k>0

Autocorrelation creates some Problems for Least Squares: 8 If we have an equation whose

Autocorrelation creates some Problems for Least Squares: 8 If we have an equation whose errors exhibit autocorrelation, but we ignore it, or are simply unaware of it, what does it have on the properties of least squares estimates? 1. The least squares estimator is still linear and unbiased but it is not efficient. 2. The formulas normally used to compute the least squares standard errors are no longer correct and confidence intervals and hypothesis tests using them will be wrong.

9 yt = 1 + 2 xt + e Autocorrelation: E(et) = 0, var(et)

9 yt = 1 + 2 xt + e Autocorrelation: E(et) = 0, var(et) = 2 , cov(et, es) = , t s Ø (Linear) Where Ø (Unbiased)

yt = 1 + 2 xt + et Autocorrelation: cov(et, es) = , t

yt = 1 + 2 xt + et Autocorrelation: cov(et, es) = , t s Incorrect formula for least squares variance: var(b 2) = 10 e 2 x x t Correct formula for least squares variance:

Generalized Least Squares AR(1) : et = et 1 + t yt = 1

Generalized Least Squares AR(1) : et = et 1 + t yt = 1 + 2 xt + et substitute in for et yt = 1 + 2 xt + et 1 + t Now we need to get rid of et 1 (continued) 11

12 yt = 1 + 2 xt + et 1 + t yt =

12 yt = 1 + 2 xt + et 1 + t yt = 1 + 2 xt + et et = yt 1 2 xt et 1 = yt 1 1 2 xt 1 lag the errors once yt = 1 + 2 xt + yt 1 1 2 xt 1 + t (continued)

13 yt = 1 + 2 xt + yt 1 1 2 xt 1

13 yt = 1 + 2 xt + yt 1 1 2 xt 1 + t yt = 1 + 2 xt + yt 1 1 2 xt 1 + t yt 1 = 1(1 ) + 2(xt xt 1) + t y*t = 1 xt 1*+ 2 xt 2* + t , yt* = yt 1 x 1 t* = (1 ) t =2, 3, …, T. x*t 2 = (xt xt 1)

yt* = yt 1 x*t 2 = xt 1 x 1 t* = (1

yt* = yt 1 x*t 2 = xt 1 x 1 t* = (1 ) 14 y*t = 1 xt 1*+ 2 xt 2* + t , Problems estimating this model with least squares: 1. One observation is used up in creating the transformed (lagged) variables leaving only (T 1) observations for estimating the model (Cochrane -Orcutt method drops the first observation). 2. The value of is not known. We must find some way to estimate it.

15 (Option) Recovering the 1 st Observation Dropping the 1 st observation and applying

15 (Option) Recovering the 1 st Observation Dropping the 1 st observation and applying least squares is not the best linear unbiased estimation method. Efficiency is lost because the variance of the error associated with the 1 st observation is not equal to that of the other errors. This is a special case of the heteroskedasticity problem except that here all errors are assumed to have equal variance except the 1 st error.

Recovering the 1 st Observation 16 The 1 st observation should fit the original

Recovering the 1 st Observation 16 The 1 st observation should fit the original model as: y 1 = 1 + 2 x 1 + e 1 with error variance: var(e 1) = e 2 = 2 /(1 - 2). We could include this as the 1 st observation for our estimation procedure but we must first transform it so that it has the same error variance as the other observations. Note: The other observations all have error variance 2.

y 1 = 1 + 2 x 1 + e 1 17 with error

y 1 = 1 + 2 x 1 + e 1 17 with error variance: var(e 1) = e 2 = 2 / (1 - 2). The other observations all have error variance 2. Given any constant c : var(ce 1) = c 2 var(e 1). If c = 1 - 2 , then var( 1 - 2 e 1) = (1 - 2) var(e 1). = (1 - 2) e 2 = (1 - 2) 2 /(1 - 2) = 2 The transformation 1 = 1 - 2 e 1 has variance 2.

18 y 1 = 1 + 2 x 1 + e 1 Multiply through

18 y 1 = 1 + 2 x 1 + e 1 Multiply through by 1 - 2 y 1 = 1 - 2 1 + The transformed error 1 = 1 - 2 to get: 1 - 2 2 x 1 + 1 - 2 e 1 has variance 2. This transformed first observation may now be added to the other (T-1) observations to obtain the fully restored set of T observations.

19 We can summarize these results by saying that, providing is known, we can

19 We can summarize these results by saying that, providing is known, we can find the Best Linear Unbiased Estimator for 1 and 2 by applying least squares to the transformed mode y*t = 1 xt 1*+ 2 xt 2* + t , t =1, 2, 3, …, T. where the transformed variables are defined by for the first observation, and for the remaining t = 2, 3, …, T observations.

Estimating Unknown Value 20 If we had values for the et , we could

Estimating Unknown Value 20 If we had values for the et , we could estimate: et = et 1 + t First, use least squares to estimate the model: yt = 1 + 2 xt + et The residuals from this estimation are: ^e = y b b x t t 1 2 t

^e = y - b x t t 1 2 t 21 Next, estimate

^e = y - b x t t 1 2 t 21 Next, estimate the following by least squares: e^t = e^t 1 + t The least squares solution is: ^ ^ e e t t-1 t=2 T ^ = 2 ^ e t-1 t=2 T

Durbin-Watson Test 22 The Durbin-Watson test is by far the most important one for

Durbin-Watson Test 22 The Durbin-Watson test is by far the most important one for detecting AR(1) errors. It is assumed that the vt are independent random errors with distribution N(0, v 2). The assumption of normally distributed random errors is needed to derive the probability distribution of the test statistic used in the Durbin. Watson test.

23 The Durbin-Watson Test statistic, d, is : 2 ^ ^ e e t

23 The Durbin-Watson Test statistic, d, is : 2 ^ ^ e e t t-1 t=2 T d = 2 ^ e t t=1 T For a null hypothesis of no autocorrelation, we can use H 0: = 0. For an alternative hypothesis we could use H 1: > 0 or H 1: < 0 or H 1: 0.

Testing for Autocorrelation 24 The test statistic, d , is approximately related to^ as:

Testing for Autocorrelation 24 The test statistic, d , is approximately related to^ as: ^ 4 0 d 2(1 ) When ^ = 0 , the Durbin-Watson statistic is d 2. When ^ = 1 , the Durbin-Watson statistic is d 0. When ^ = 1, the Durbin-Watson statistic is d 4. Tables for critical values for d are not always readily available so it is easier to use the p-value that most computer programs provide for d. Reject H 0 if p-value < , the significance level.

Test for the first-order autocorrelation H 1: > 0 25 Reject H 0 Inclusive

Test for the first-order autocorrelation H 1: > 0 25 Reject H 0 Inclusive Do not reject H 0 d < d. L < d. U d > d. U H 1: < 0 d > 4 d. L 4 d. U < d < 4 d. L d < 4 d. U H 1: 0 d > 4 d. L 4 d. U < d < 4 d. L or or d. U < d < 4 d. U d < d. L < d. U Note: The lower and upper bounds (d. L and d. U) depend on sample size n and the number of explanatory variables k (not include intercept).

26 A. Test for Positive Autocorrelation >0 0 Inclusive d. U d. L No

26 A. Test for Positive Autocorrelation >0 0 Inclusive d. U d. L No evidence of positive autocorrelation 2 4 B. Test for Negative Autocorrelation No evidence of negative autocorrelation 2 0 Inclusive 4 d. U <0 4 d. L 4 C. Two-Sided Test for Autocorrelation >0 0 Inclusive d. L d. U No evidence of autocorrelation 2 Inclusive 4 d. U <0 4 d. L 4

Prediction with AR(1) Errors 27 When errors are autocorrelated, the previous period� error may

Prediction with AR(1) Errors 27 When errors are autocorrelated, the previous period� error may help us predict next period�error. The best predictor, y. T+1 , for next period is: ^ ^ ~ ^y ^ T+1 = 1 + 2 x. T+1 + e. T ^ ^ where 1 and 2 are generalized least squares ~ estimates and e. T is given by: ~ ^ ^ e =y x T T 1 2 T

28 For h periods ahead, the best predictor is: ^ ^ ~ ^y ^

28 For h periods ahead, the best predictor is: ^ ^ ~ ^y ^ h T+h = 1 + 2 x. T+h + e. T ~ ^ ^ h Assuming | | < 1, the influence of e. T diminishes the further we go into the future (the larger h becomes).