35
FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending t t t X X X ˆ ~ Use Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period fits. One response was to search for ways of constructing models that avoided the fitting of spurious relationships. t t u t a a X 2 1 ˆ Fit

FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

Embed Size (px)

Citation preview

Page 1: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

1

Detrending

ttt XXX ˆ~ Use

Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period fits. One response was to search for ways of constructing models that avoided the fitting of spurious relationships.

tt utaaX 21ˆFit

Page 2: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

2

Detrending

ttt XXX ˆ~ Use

We will briefly consider three of them: detrending the variables in a relationship, differencing them, and constructing error-correction models.

tt utaaX 21ˆFit

Page 3: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

3

Detrending

ttt XXX ˆ~ Use

For models where the variables possess deterministic trends, the fitting of spurious relationships can be avoided by detrending the variables before use or, equivalently, by including a time trend as a regressor in the model.

tt utaaX 21ˆFit

Page 4: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

4

Detrending

Problems if Xt is a random walk

ttt XXX ˆ~ Use

t

ttt

X

XX

...10

1

22 t

tX

However, if the variables are difference-stationary rather than trend-stationary — and for many macroeconomic variables there is evidence that this is the case — the detrending procedure is inappropriate and likely to give rise to misleading results.

tt utaaX 21ˆFit

Page 5: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

5

Detrending

Problems if Xt is a random walk

H0: 2 = 0 rejected more often than it should be(standard error underestimated)

ttt XXX ˆ~ Use

t

ttt

X

XX

...10

1

22 t

tX

In particular, if a random walk Xt is regressed on a time trend as in the equation at the top, the null hypothesis H0: 2 = 0 is likely to be rejected more often than it should, given the significance level.

tt utaaX 21ˆFit

Page 6: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

6

Detrending

Problems if Xt is a random walk

H0: 2 = 0 rejected more often than it should be(standard error underestimated)

ttt XXX ˆ~ Use

t

ttt

X

XX

...10

1

22 t

tX

Although the least squares estimator of 2 is consistent, and thus will tend to 0 in large samples, its standard error is biased downwards. As a consequence, in finite samples deterministic trends will tend to be detected, even when not present.

tt utaaX 21ˆFit

Page 7: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

7

Further, if a series is difference-stationary, the procedure does not make it stationary. In the case of a random walk, extracting a non-existent trend in the mean of the series can do nothing to alter the trend in its variance, and the series remains nonstationary.

Detrending

Problems if Xt is a random walk

H0: 2 = 0 rejected more often than it should be(standard error underestimated)

Trend in variance not removed

ttt XXX ˆ~ Use

t

ttt

X

XX

...10

1

22 t

tX

tt utaaX 21ˆFit

Page 8: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

8

Detrending

Problems if Xt is a random walk with drift

H0: 2 = 0 rejected more often than it should be(standard error underestimated)

Trend in variance not removed

tt utaaX 21ˆFit

ttt XXX ˆ~ Use

t

ttt

tX

XX

...110

11

22 t

tX

In the case of a random walk with drift, detrending can remove the drift, but not the trend in the variance.

Page 9: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

9

Detrending

Problems if Xt is a random walk with drift

H0: 2 = 0 rejected more often than it should be(standard error underestimated)

Trend in variance not removed

tt utaaX 21ˆFit

ttt XXX ˆ~ Use

t

ttt

tX

XX

...110

11

22 t

tX

Thus if Xt is a random walk, with or without drift, the problem of spurious regressions is not resolved, and for this reason detrending is not usually considered to be an appropriate procedure.

Page 10: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

10

In early time series studies, if the disturbance term in a model was believed to be subject to severe positive AR(1) autocorrelation, a common rough-and-ready remedy was to regress the model in differences rather than levels.

Differencing

ttt uXY 21

ttt uXY 2

ttt uu 1

tttt uXY 12 )1(

Page 11: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

11

Of course differencing overcompensated for the autocorrelation, but if was near 1, the resulting weak negative autocorrelation was held to be relatively innocuous.

Differencing

ttt uXY 21

ttt uXY 2

ttt uu 1

tttt uXY 12 )1(

Page 12: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

12

Unknown to practitioners of the time, the procedure is an effective antidote to spurious regressions. If both Yt and Xt are unrelated I(1) processes, they are stationary in the differenced model and the absence of any relationship will be revealed.

Differencing

ttt uXY 21

ttt uXY 2

ttt uu 1

tttt uXY 12 )1(

Page 13: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

13

A major shortcoming of differencing is that it precludes the investigation of a long-run relationship.

Differencing

Problem

Short-run dynamics only

ttt uXY 21

ttt uXY 2

ttt uu 1

tttt uXY 12 )1(

Page 14: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

14

In equilibrium Y = X = 0, and if one substitutes these values into the second equation, one obtains, not an equilibrium relationship, but an equation in which both sides are 0.

Differencing

Problem

Short-run dynamics only

Equilibrium:

ttt uXY 21

ttt uXY 2

ttt uu 1

tttt uXY 12 )1(

0 XY

Page 15: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

15

An error-correction model is an ingenious way of resolving this problem by combining a long-run cointegrating relationship with short-run dynamics.

Error-correction models

ADL(1,1) ttttt XXYY 143121

Page 16: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

16

Suppose that the relationship between two I(1) variables Yt and Xt is characterized by an ADL(1,1) model.

ttttt XXYY 143121

Error-correction models

ADL(1,1)

Page 17: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

17

In equilibrium we would have the relationship shown. This is the cointegrating relationship.

ttttt XXYY 143121

XXYY 4321

XY )()1( 4312

XY2

43

2

1

11

Error-correction models

ADL(1,1)

Page 18: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

18

The ADL(1,1) relationship may be rewritten to incorporate this relationship. First we subtract Yt–1 from both sides.

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

Error-correction models

ADL(1,1)

Page 19: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

19

Then we add 3Xt–1 to the right side and subtract it again.

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

Error-correction models

ADL(1,1)

Page 20: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

20

We then rearrange the equation as shown. We will look at the rearrangement, term by term. First, the intercept 1.

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

Error-correction models

ADL(1,1)

Page 21: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

21

Next, the term involving Yt–1.

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

Error-correction models

ADL(1,1)

Page 22: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

22

Now the next two terms.

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

Error-correction models

ADL(1,1)

Page 23: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

23

Finally, the last two terms.

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

Error-correction models

ADL(1,1)

Page 24: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

24

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

ttttt XXYY

31

2

43

2

112 11

)1(

Hence we obtain a model that states that the change in Y in any period will be governed by the change in X and the discrepancy between Yt–1 and the value predicted by the cointegrating relationship.

Error-correction models

ADL(1,1)

Page 25: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

25

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

ttttt XXYY

31

2

43

2

112 11

)1(

The latter term is denoted the error-correction mechanism. The effect of this term is to reduce the discrepancy between Yt and its cointegrating level. The size of the adjustment is proportional to the discrepancy.

Error-correction models

ADL(1,1)

Page 26: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

26

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

ttttt XXYY

31

2

43

2

112 11

)1(

The point of rearranging the ADL(1,1) model in this way is that, although Yt and Xt are both I(1), all of the terms in the regression equation are I(0) and hence the model may be fitted using least squares in the standard way.

Error-correction models

ADL(1,1)

Page 27: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

27

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

ttttt XXYY

31

2

43

2

112 11

)1(

Of course, the parameters are not known and the cointegrating term is unobservable.

Error-correction models

ADL(1,1)

Page 28: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

28

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

ttttt XXYY

31

2

43

2

112 11

)1(

One way of overcoming this problem, known as the Engle–Granger two-step procedure, is to use the values of the parameters estimated in the cointegrating regression to compute the cointegrating term.

Error-correction models

ADL(1,1)

Page 29: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

29

ttttt XXYY 143121

ttttt

tttttt

tttttt

XXXY

XXXXY

XXYYY

)(11

)1(

)1(

)1(

1312

43

2

112

1413133121

1431211

ttttt XXYY

31

2

43

2

112 11

)1(

It can be demonstrated that the estimators of the coefficients of the fitted equation will have the same properties asymptotically as if the true values had been used.

Error-correction models

ADL(1,1)

Page 30: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

FITTING MODELS WITH NONSTATIONARY TIME SERIES

30

The EViews output shows the results of fitting an error-correction model for the demand function for food using the Engle–Granger two-step procedure, on the assumption that the static logarithmic model is a cointegrating relationship.

============================================================Dependent Variable: DLGFOOD Method: Least Squares Sample(adjusted): 1960 2003 Included observations: 44 after adjusting endpoints ============================================================ Variable CoefficientStd. Errort-Statistic Prob. ============================================================ ZFOOD(-1) -0.148063 0.105268 -1.406533 0.1671 DLGDPI 0.493715 0.050948 9.690642 0.0000 DLPRFOOD -0.353901 0.115387 -3.067086 0.0038 ============================================================R-squared 0.343031 Mean dependent var 0.018243 Adjusted R-squared 0.310984 S.D. dependent var 0.015405 S.E. of regression 0.012787 Akaike info criter-5.815054 Sum squared resid 0.006704 Schwarz criterion -5.693405 Log likelihood 130.9312 Durbin-Watson stat 1.526946 ============================================================

Page 31: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

============================================================Dependent Variable: DLGFOOD Method: Least Squares Sample(adjusted): 1960 2003 Included observations: 44 after adjusting endpoints ============================================================ Variable CoefficientStd. Errort-Statistic Prob. ============================================================ ZFOOD(-1) -0.148063 0.105268 -1.406533 0.1671 DLGDPI 0.493715 0.050948 9.690642 0.0000 DLPRFOOD -0.353901 0.115387 -3.067086 0.0038 ============================================================R-squared 0.343031 Mean dependent var 0.018243 Adjusted R-squared 0.310984 S.D. dependent var 0.015405 S.E. of regression 0.012787 Akaike info criter-5.815054 Sum squared resid 0.006704 Schwarz criterion -5.693405 Log likelihood 130.9312 Durbin-Watson stat 1.526946 ============================================================

FITTING MODELS WITH NONSTATIONARY TIME SERIES

31

In the output, DLGFOOD, DLGDPI, and DLPRFOOD are the differences in the logarithms of expenditure on food, disposable personal income, and the relative price of food, respectively.

ttttt XXYY

31

2

43

2

112 11

)1(

Page 32: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

============================================================Dependent Variable: DLGFOOD Method: Least Squares Sample(adjusted): 1960 2003 Included observations: 44 after adjusting endpoints ============================================================ Variable CoefficientStd. Errort-Statistic Prob. ============================================================ ZFOOD(-1) -0.148063 0.105268 -1.406533 0.1671 DLGDPI 0.493715 0.050948 9.690642 0.0000 DLPRFOOD -0.353901 0.115387 -3.067086 0.0038 ============================================================R-squared 0.343031 Mean dependent var 0.018243 Adjusted R-squared 0.310984 S.D. dependent var 0.015405 S.E. of regression 0.012787 Akaike info criter-5.815054 Sum squared resid 0.006704 Schwarz criterion -5.693405 Log likelihood 130.9312 Durbin-Watson stat 1.526946 ============================================================

FITTING MODELS WITH NONSTATIONARY TIME SERIES

32

ZFOOD(–1), the lagged residual from the cointegrating regression, is the cointegration term.

ttttt XXYY

31

2

43

2

112 11

)1(

Page 33: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

============================================================Dependent Variable: DLGFOOD Method: Least Squares Sample(adjusted): 1960 2003 Included observations: 44 after adjusting endpoints ============================================================ Variable CoefficientStd. Errort-Statistic Prob. ============================================================ ZFOOD(-1) -0.148063 0.105268 -1.406533 0.1671 DLGDPI 0.493715 0.050948 9.690642 0.0000 DLPRFOOD -0.353901 0.115387 -3.067086 0.0038 ============================================================R-squared 0.343031 Mean dependent var 0.018243 Adjusted R-squared 0.310984 S.D. dependent var 0.015405 S.E. of regression 0.012787 Akaike info criter-5.815054 Sum squared resid 0.006704 Schwarz criterion -5.693405 Log likelihood 130.9312 Durbin-Watson stat 1.526946 ============================================================

FITTING MODELS WITH NONSTATIONARY TIME SERIES

33

The coefficient of DLGDPI and DLPRFOOD provide estimates of the short-run income and price elasticities, respectively. As might be expected, they are both quite low.

ttttt XXYY

31

2

43

2

112 11

)1(

Page 34: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

============================================================Dependent Variable: DLGFOOD Method: Least Squares Sample(adjusted): 1960 2003 Included observations: 44 after adjusting endpoints ============================================================ Variable CoefficientStd. Errort-Statistic Prob. ============================================================ ZFOOD(-1) -0.148063 0.105268 -1.406533 0.1671 DLGDPI 0.493715 0.050948 9.690642 0.0000 DLPRFOOD -0.353901 0.115387 -3.067086 0.0038 ============================================================R-squared 0.343031 Mean dependent var 0.018243 Adjusted R-squared 0.310984 S.D. dependent var 0.015405 S.E. of regression 0.012787 Akaike info criter-5.815054 Sum squared resid 0.006704 Schwarz criterion -5.693405 Log likelihood 130.9312 Durbin-Watson stat 1.526946 ============================================================

FITTING MODELS WITH NONSTATIONARY TIME SERIES

34

The coefficient of the cointegrating term indicates that about 15 percent of the disequilibrium divergence tends to be eliminated in one year.

ttttt XXYY

31

2

43

2

112 11

)1(

Page 35: FITTING MODELS WITH NONSTATIONARY TIME SERIES 1 Detrending Early macroeconomic models tended to produce poor forecasts, despite having excellent sample-period

Copyright Christopher Dougherty 2002–2006. This slideshow may be freely copied for personal use.

22.08.06