STAT 497 LECTURE NOTES 5

61
STAT 497 LECTURE NOTES 5 UNIT ROOT TESTS 1

description

STAT 497 LECTURE NOTES 5. UNIT ROOT TESTS. UNIT ROOTS IN TIME SERIES MODELS. Shock is usually used to describe an unexpected change in a variable or in the value of the error terms at a particular time period. When we have a stationary system, effect of a shock will die out gradually. - PowerPoint PPT Presentation

Transcript of STAT 497 LECTURE NOTES 5

Page 1: STAT 497 LECTURE NOTES 5

STAT 497LECTURE NOTES 5

UNIT ROOT TESTS

1

Page 2: STAT 497 LECTURE NOTES 5

UNIT ROOTS IN TIME SERIES MODELS

• Shock is usually used to describe an unexpected change in a variable or in the value of the error terms at a particular time period.

• When we have a stationary system, effect of a shock will die out gradually.

• When we have a non-stationary system, effect of a shock is permanent.

2

Page 3: STAT 497 LECTURE NOTES 5

UNIT ROOTS IN TIME SERIES MODELS

• Two types of non-stationarity:– Unit root i.e.,|i| = 1: homogeneous non-stationarity

– |i| > 1: explosive non-stationarity• Shock to the system become more influential as time goes

on.• Can never be seen in real life

3

Page 4: STAT 497 LECTURE NOTES 5

UNIT ROOTS IN TIME SERIES MODELS

ttt aYY 1

TtT

tttTtT

t aaaaYY 22

1

. as 01 TT

. as 11 TT

. as 1 TT

e.g. AR(1)

4

Page 5: STAT 497 LECTURE NOTES 5

UNIT ROOTS IN TIME SERIES MODELS

• A root near 1 of the AR polynomial

differencing

• A root near 1 of the MA polynomial

over-differencing

5

Page 6: STAT 497 LECTURE NOTES 5

UNIT ROOTS IN AUTOREGRESSION

1. DICKEY-FULLER (DF) TEST: The simplest approach to test for a unit root begins with AR(1) model

• DF test actually does not consider 0 in the model, but actually model with 0 and not 0 gives different results.

.,0_~ where 2

10

at

ttt

WNNormala

aYY

6

Page 7: STAT 497 LECTURE NOTES 5

DF TEST

• Consider the hypothesis

• The hypothesis is the reverse of KPSS test.

0~1:

1~1:

1

0

IYH

IYH

t

t

7

Page 8: STAT 497 LECTURE NOTES 5

DF TEST

• To simplify the computation, subtract Yt-1 from both sides of the AR(1) model;

• If =0, system has a unit root.

8

ttt

tttt

aYY

aYYY

10

101 1

0

0

1

0

:H

:H

Page 9: STAT 497 LECTURE NOTES 5

DF TEST

• DF (1979)

9

trendelinear tim a anddrift addsY

driftRW with Y

RW Pure

110t

10t

1

tt

tt

ttt

aYt

aY

aYY

Page 10: STAT 497 LECTURE NOTES 5

DF TEST

• Applying OLS method and finding the estimator for , the test statistic is given by

• The test is a one-sided left tail test. If {Yt} is stationary (i.e.,|φ| < 1) then it can be shown

10

ˆ..1ˆ

1 est

.1,0ˆ 2 Nnd

• This means that under H0, the limiting distribution of t=1 is N(0,1).

Page 11: STAT 497 LECTURE NOTES 5

DF TEST

• Under the null hypothesis,

which does not make any sense. Under the unit root null, {Yt} is not stationary and ergodic, and the usual sample moments do not converge to fixed constants. Instead, Phillips (1987) showed that the sample moments of {Yt} converge to random functions of Brownian motion

11

0,1~ˆ NA

Page 12: STAT 497 LECTURE NOTES 5

DF TEST

12

where W(r) denotes a standard Brownian motion (Wiener process) defined on the unit interval.

1

011

1

1

0

22

1

21

2

1

011

2/3

drrWaYn

rdWrWYn

drrWYn

dn

ttt

dn

tt

dn

tt

Page 13: STAT 497 LECTURE NOTES 5

DF TEST• Using the above results Phillips showed that

under the unit root null H0 : φ = 1

13

1

0

2

1

01ˆ1drrW

rdWrWn

d

2/11

0

2

1

01

drrW

rdWrWt

d

Page 14: STAT 497 LECTURE NOTES 5

DF TEST

SOME RESULTS • is super-consistent; that is, at rate n

instead of the usual rate.• is not asymptotically normally distributed and

tφ=1 is not asymptotically standard normal.• The limiting distribution of tφ=1 is called the

Dickey-Fuller (DF) distribution and does not have a closed form representation. Consequently, quantiles of the distribution must be computed by numerical approximation or by simulation.

14

p

ˆ

Page 15: STAT 497 LECTURE NOTES 5

DF TEST

• Since the normalized bias (n1)( − 1) has a well defined limiting distribution that does not depend on nuisance parameters it can also be used as a test statistic for the null hypothesis H0 : φ = 1.

15

Page 16: STAT 497 LECTURE NOTES 5

DF TEST

• EXAMPLE:

16

10509.0

1948.0ˆ tt YY

7646.119481.0341ˆ135 nn

Critical value: 7.3 for n=25 7.7 for n=50

=0.05

Not reject H0. There exist a unit root. We need to take a difference to be able to estimate a model for the series

Page 17: STAT 497 LECTURE NOTES 5

DF TEST• With a constant term:The test regression is

and includes a constant to capture the nonzero mean under the alternative. The hypotheses to be tested

This formulation is appropriate for non-trending economic and financial series like interest rates, exchange rates and spreads.

17

ttt aYY 10

mean withI~Y:H

drift withoutI~Y,:H

t1

t

01

101 00

Page 18: STAT 497 LECTURE NOTES 5

DF TEST• The test statistics tφ=1 and (n − 1)( − 1) are

computed from the above regression. Under H0 : φ = 1, c = 0 the asymptotic distributions of these test statistics are influenced by the presence, but not the coefficient value, of the constant in the test regression:

18

Page 19: STAT 497 LECTURE NOTES 5

DF TEST

19

Inclusion of a constant pushes the distributions of tφ=1 and (n1) ( − 1) to the left.

2/11

0

2

1

01

1

0

2

1

01ˆ1

drrW

rdWrWt

drrW

rdWrWn

d

d

01

0

1

0

drrW i.e., process,

Wiener meaned-de a is drrWrWrW where

Page 20: STAT 497 LECTURE NOTES 5

DF TEST• With constant and trend termThe test regression is

and includes a constant and deterministic time trend to capture the deterministic trend under the alternative. The hypotheses to be tested

20

ttt aYtY 10

trend time ticdeterminis withIYH

drift withIYH

t1

t

0~1:

1~0,1:0

Page 21: STAT 497 LECTURE NOTES 5

DF TEST

• This formulation is appropriate for trending time series like asset prices or the levels of macroeconomic aggregates like real GDP. The test statistics tφ=1 and (n − 1) ( − 1) are computed from the above regression.

• Under H0 : φ = 1, δ = 0 the asymptotic distributions of these test statistics are influenced by the presence but not the coefficient values of the constant and time trend in the test regression.

21

Page 22: STAT 497 LECTURE NOTES 5

DF TEST

22

2/11

0

2

1

01

1

0

2

1

01ˆ1

drrW

rdWrWt

drrW

rdWrWn

d

d

process. Wiener trended-de and meaned-de a is

drrWsrrWrW where

1

0 21

21

12

Page 23: STAT 497 LECTURE NOTES 5

DF TEST

• The inclusion of a constant and trend in the test regression further shifts the distributions of tφ=1 and (n − 1)( − 1) to the left.

23

Page 24: STAT 497 LECTURE NOTES 5

DF TEST

• What do we conclude if H0 is not rejected? The

series contains a unit root, but is that it? No!

What if Yt I(2)∼ ? We would still not have rejected.

So we now need to test

H0: Yt I(2) vs. H∼ 1: Yt I(1)∼

• We would continue to test for a further unit root

until we rejected H0.24

Page 25: STAT 497 LECTURE NOTES 5

DF TEST• This test is valid only if at is WN. If there is a serial

correlation, the test should be augmented. So, check for possible autoregression in at.

• Many economic and financial time series have a more complicated dynamic structure than is captured by a simple AR(1) model.

• Said and Dickey (1984) augment the basic autoregressive unit root test to accommodate general ARMA(p, q) models with unknown orders and their test is referred to as the augmented Dickey- Fuller (ADF) test.

25

Page 26: STAT 497 LECTURE NOTES 5

AUGMENTED DICKEY-FULLER (ADF) TEST

• If serial correlation exists in the DF test equation (i.e., if the true model is not AR(1)), then use AR(p) to get rid of the serial correlation.

26

root. unit a contain mayBBB and

aE with,WN~a where

aYB

ppp

tat

ttp

1

42

0

1

0

Page 27: STAT 497 LECTURE NOTES 5

ADF TEST

• To test for a unit root, we assume that

27

circle. unit the outside lying

roots has BBB where

BBB

ppp

pp

1111

1

1

1

t

p

jjtjt

ttp

ttp

aYY

aYB

aYBB

0

1

1

01

01 1

Page 28: STAT 497 LECTURE NOTES 5

ADF TEST

• Hence, testing for a unit root is equivalent to testing =1 in the following model

28

t

p

jjtjtt aYYY:equation test ADF

0

1

11

or t

p

jjtjtt aYYY

0

1

111

t

p

jjtjtt aYYY:equation test ADF

0

1

11

Page 29: STAT 497 LECTURE NOTES 5

ADF TEST

• Hypothesis

29

1:

1:

1

0

H

H

0:

0:

1

0

H

H

Reject H0 if t=1<CV Reject H0 if t=0<CV

• We can also use the following test statistics: 11ˆ pn

model. the of RSF from obtained where 2111

Page 30: STAT 497 LECTURE NOTES 5

ADF TEST

• The limiting distribution of the test statistic

is non-standard distribution (function of Brownian motion _ or Wiener process).

30

11ˆ pn

Page 31: STAT 497 LECTURE NOTES 5

Choosing the Lag Length for the ADF Test

• An important practical issue for the

implementation of the ADF test is the

specification of the lag length p. If p is too

small, then the remaining serial correlation in

the errors will bias the test. If p is too large,

then the power of the test will suffer.

31

Page 32: STAT 497 LECTURE NOTES 5

Choosing the Lag Length for the ADF Test

• Ng and Perron (1995) suggest the following data dependent lag length selection procedure that results in stable size of the test and minimal power loss:

• First, set an upper bound pmax for p. Next, estimate the ADF test regression with p = pmax. If the absolute value of the t-statistic for testing the significance of the last lagged difference is greater than 1.6, then set p = pmax and perform the unit root test. Otherwise, reduce the lag length by one and repeat the process.

32

Page 33: STAT 497 LECTURE NOTES 5

Choosing the Lag Length for the ADF Test

• A useful rule of thumb for determining pmax, suggested by Schwert (1989), is

where [x] denotes the integer part of x. This choice allows pmax to grow with the sample so that the ADF test regressions are valid if the errors follow an ARMA process with unknown order.

33

4/1

max 10012

np

Page 34: STAT 497 LECTURE NOTES 5

ADF TEST

• EXAMPLE: n=54Examine the original model and the differenced one to determine the order of AR parameters. For this example, p=3.

Fit the model with t = 4, 5,…, 54.

34

ttttt aYYYY 221110

21369.0

11353.0

108699.097.87

326.0141.0856.0139 tttt YYYY

:equation OLS

Page 35: STAT 497 LECTURE NOTES 5

ADF TEST• EXAMPLE (contd.) Under H0,

35

.1

111/

1

2211

2210

BBBB and BB where

aBYB

p

tt

843.0185.1

1

326.0141.01

11

3.1319.611ˆ pn

n=50, CV=-13.3

• H0 cannot be rejected. There is a unit root. The series should be differenced.

Page 36: STAT 497 LECTURE NOTES 5

ADF TEST• If the test statistics is positive, you can

automatically decide to not reject the null hypothesis of unit root.

• Augmented model can be extended to allow MA terms in at. It is generally believed that MA terms are present in many macroeconomic time series after differencing. Said and Dickey (1984) developed an approach in which the orders of the AR and MA components in the error terms are unknown, but can be approximated by an AR(k) process where k is large enough to allow good approximation to the unknown ARMA(p,q) process.

36

Page 37: STAT 497 LECTURE NOTES 5

ADF TEST

• Ensuring that at is approximately WN

37

tt

nk whereB

q

ptqtp aY

B

BaBYB

k

3

Page 38: STAT 497 LECTURE NOTES 5

PHILLIPS-PERRON (PP) UNIT ROOT TEST• Phillips and Perron (1988) have developed a more

comprehensive theory of unit root nonstationarity. The tests are similar to ADF tests. The Phillips-Perron (PP) unit root tests differ from the ADF tests mainly in how they deal with serial correlation and heteroskedasticity in the errors. In particular, where the ADF tests use a parametric autoregression to approximate the ARMA structure of the errors in the test regression, the PP tests ignore any serial correlation in the test regression.

• The tests usually give the same conclusions as the ADF tests, and the calculation of the test statistics is complex.

38

Page 39: STAT 497 LECTURE NOTES 5

PP TEST• Consider a model

DF: at ~ iid

PP: at ~ serially correlated

• Add a correction factor to the DF test statistic. (ADF is to add lagged ΔYt to ‘whiten’ the serially correlated residuals)

39

ttt aYY 10

ttt aYY :equation test PP 10

Page 40: STAT 497 LECTURE NOTES 5

PP TEST

• The hypothesis to be tested:

40

0:

0:

1

0

H

H

Page 41: STAT 497 LECTURE NOTES 5

PP TEST• The PP tests correct for any serial correlation and

heteroskedasticity in the errors at of the test regression by directly modifying the test statistics t=0 and . These modified statistics, denoted Zt and Z, are given by

41

n

22

22

ˆ2

2

ˆ

ˆ..ˆ

ˆˆ

21

ˆˆ

esn

tZt

222

2

ˆˆˆ

ˆ..21ˆ

esn

nZ

The terms and are consistent estimates of the variance parameters

2

n

tt

naEn

1

212 lim

n

t

n

tt

na

nE

1 1

22 1lim

Page 42: STAT 497 LECTURE NOTES 5

PP TEST

• Under the null hypothesis that = 0, the PP Zt and Z statistics have the same asymptotic distributions as the ADF t-statistic and normalized bias statistics.

• One advantage of the PP tests over the ADF tests is that the PP tests are robust to general forms of heteroskedasticity in the error term at. Another advantage is that the user does not have to specify a lag length for the test regression.

42

Page 43: STAT 497 LECTURE NOTES 5

PROBLEM OF PP TEST• On the other hand, the PP tests tend to be more

powerful but, also subject to more severe size distortions – Size problem: actual size is larger than the nominal

one when autocorrelations of at are negative.– more sensitive to model misspecification (the order

of autoregressive and moving average components).• Plotting ACFs help us to detect the potential size

problem– Economic time series sometimes have negative

autocorrelations especially at lag one, we can use a Monte Carlo analysis to simulate the appropriate critical values, which may not be attractive to do.

43

Page 44: STAT 497 LECTURE NOTES 5

Criticism of Dickey-Fuller and Phillips-Perron Type Tests

• Main criticism is that the power of the tests is low if the process is stationary but with a root close to the non-stationary boundary.

• e.g. the tests are poor at deciding if φ=1 or φ=0.95, especially with small sample sizes.

• If the true data generating process (dgp) is Yt= 0.95Yt-1+ at

then the null hypothesis of a unit root should be rejected.

• One way to get around this is to use a stationarity test (like KPSS test) as well as the unit root tests we have looked at (like ADF or PP).

44

Page 45: STAT 497 LECTURE NOTES 5

Criticism of Dickey-Fuller and Phillips-Perron Type Tests

• The ADF and PP unit root tests are known (from MC simulations) to suffer potentially severe finite sample power and size problems.1. Power – The ADF and PP tests are known to have low power against the alternative hypothesis that the series is stationary (or TS) with a large autoregressive root. (See, e.g., DeJong, et al, J. of Econometrics, 1992.) 2. Size – The ADF and PP tests are known to have severe size distortion (in the direction of over-rejecting the null) when the series has a large negative moving average root. (See, e.g., Schwert. JBES, 1989: MA = -0.8, size = 100%!)

45

Page 46: STAT 497 LECTURE NOTES 5

Criticism of Dickey-Fuller and Phillips-Perron Type Tests

• A variety of alternative procedures have been proposed that try to resolve these problems, particularly, the power problem, but the ADF and PP tests continue to be the most widely used unit root tests. That may be changing!

46

Page 47: STAT 497 LECTURE NOTES 5

STRUCTURAL BREAKS• A stationary time-series may look like

nonstationary when there are structural breaks in the intercept or trend

• The unit root tests lead to false non-rejection of the null when we don’t consider the structural breaks low power

• A single breakpoint is introduced in Perron (1989) into the regression model; Perron (1997) extended it to a case of unknown breakpoint

• Perron, P., (1989), “The Great Crash, the Oil Price Shock and the Unit Root Hypothesis,” Econometrica, 57, 1361–1401.

47

Page 48: STAT 497 LECTURE NOTES 5

STRUCTURAL BREAKSConsider the null and alternative hypotheses

H0: Yt = a0 + Yt-1 + µ1DP + at

H1: Yt = a0 + a2t + µ2DL + at

Pulse break: DP = 1 if t = TB + 1 and zero otherwise, Level break: DL = 0 for t = 1, . . . , TB and one otherwise.

Null: Yt contains a unit root with a one–time jump in the level of the series at time t = TB + 1 .

Alternative: Yt is trend stationary with a one–time jump in the intercept at time t = TB + 1 .

48

Page 49: STAT 497 LECTURE NOTES 5

49

Simulated unit root and trend stationary processes with structural break.

H0: ------• a0 = 0.5, • DP = 1 for n = 51 zero otherwise,• µ1 = 10.

H0: ------• a0 = 0.5, • DP = 1 for n = 51 zero otherwise,• µ1 = 10.

H1: • a2 = 0.5,• DL = 1 for n > 50.• µ2 = 10

H1: • a2 = 0.5,• DL = 1 for n > 50.• µ2 = 10

n= 100 at ~ i.i.d. N(0,1)y0=0

Page 50: STAT 497 LECTURE NOTES 5

Power of ADF tests: Rejection frequencies of ADF–tests

• ADF tests are biased toward non-rejection of the null. • Rejection frequency is inversely related to the magnitude of

the shift.• Perron: estimated values of the autoregressive parameter

in the Dickey–Fuller regression was biased toward unity and that this bias increased as the magnitude of the break increased.

50

Page 51: STAT 497 LECTURE NOTES 5

112/04/22 51

Testing for unit roots when there are structural changes

Perron suggests running the following OLS regression:

H0: a1 = 1; t–ratio, DF unit root test. Perron shows that the asymptotic distribution of the t-statistic depends on the location of the structural break, = TB/n

critical values are supplied in Perron (1989) for different assumptions about l, see Table IV.B.

0 1 1 2 21

p

t t L i t i ti

y a a y a t D y

Page 52: STAT 497 LECTURE NOTES 5

EXAMPLE• Consider following time series plots

52

Page 53: STAT 497 LECTURE NOTES 5

KPSS RESULTS> kpss.test(y,c("Level"))

KPSS Test for Level Stationarity

data: y

KPSS Level = 3.4581, Truncation lag parameter = 2, p-value = 0.01

Warning message:

In kpss.test(y, c("Level")) : p-value smaller than printed p-value

> kpss.test(y,c("Trend"))

KPSS Test for Trend Stationarity

data: y

KPSS Trend = 0.5894, Truncation lag parameter = 2, p-value = 0.01

Warning message:

In kpss.test(y, c("Trend")) : p-value smaller than printed p-value

53

There is a stochastic trend. We need differencing to observe stationary series.

Page 54: STAT 497 LECTURE NOTES 5

PP TEST RESULTS> pp.test(y)

Phillips-Perron Unit Root Test

data: y

Dickey-Fuller Z(alpha) = -11.1817, Truncation lag parameter = 4,

p-value = 0.4673

alternative hypothesis: stationary

54

Page 55: STAT 497 LECTURE NOTES 5

ADF TEST RESULT• To decide the lag order

55

Page 56: STAT 497 LECTURE NOTES 5

ADF TEST RESULTS• Load ‘fUnitRoot’ package> adfTest(y, lags = 5, type = c("nc"))

Title:

Augmented Dickey-Fuller Test

Test Results:

PARAMETER:

Lag Order: 5

STATISTIC:

Dickey-Fuller: -0.3663

P VALUE:

0.4964

> adfTest(y, lags = 5, type = c("c"))

Title:

Augmented Dickey-Fuller Test

Test Results:

PARAMETER:

Lag Order: 5

STATISTIC:

Dickey-Fuller: 0.6517

P VALUE:

0.99

56

Unit root test with no drift

Unit root test with drift

Page 57: STAT 497 LECTURE NOTES 5

ADF TEST RESULTS> adfTest(y, lags = 5, type = c("ct"))

Title:

Augmented Dickey-Fuller Test

Test Results:

PARAMETER:

Lag Order: 5

STATISTIC:

Dickey-Fuller: -2.4843

P VALUE:

0.3759

57

Unit root test with drift and trend

Combining results of ADF and KPSS tests, we can say that there is a stochastic trend. Differencing is needed.

Page 58: STAT 497 LECTURE NOTES 5

REPEAT TESTS ON DIFFERECED SERIES

> kpss.test(ydif,c("Level"))

KPSS Test for Level Stationarity

data: ydif

KPSS Level = 0.1041, Truncation lag parameter = 2, p-value = 0.1

Warning message:

In kpss.test(ydif, c("Level")) : p-value greater than printed p-value

> kpss.test(ydif,c("Trend"))

KPSS Test for Trend Stationarity

data: ydif

KPSS Trend = 0.0763, Truncation lag parameter = 2, p-value = 0.1

Warning message:

In kpss.test(ydif, c("Trend")) : p-value greater than printed p-value

58

No need after getting the above result.

Page 59: STAT 497 LECTURE NOTES 5

ADF TEST ON DIFFERENCED SERIES> adfTest(ydif, lags = 5, type = c("nc"))

Title:

Augmented Dickey-Fuller Test

Test Results:

PARAMETER:

Lag Order: 5

STATISTIC:

Dickey-Fuller: -0.1808

P VALUE:

0.5555

> adfTest(ydif, lags = 5, type = c("c"))

Title:

Augmented Dickey-Fuller Test

Test Results:

PARAMETER:

Lag Order: 5

STATISTIC:

Dickey-Fuller: -5.1038

P VALUE:

0.01

59

When you apply ADF test on a differenced series, use unit root test with no drift term. Differencing makes the constant part zero.

So, use this test result

Page 60: STAT 497 LECTURE NOTES 5

ADF TEST ON DIFFERENCED SERIES> adfTest(ydif, lags = 5, type = c("ct"))

Title:

Augmented Dickey-Fuller Test

Test Results:

PARAMETER:

Lag Order: 5

STATISTIC:

Dickey-Fuller: -5.0923

P VALUE:

0.01

60

Page 61: STAT 497 LECTURE NOTES 5

PP TEST ON DIFFERENCED SERIES> pp.test(ydif)

Phillips-Perron Unit Root Test

data: ydif

Dickey-Fuller Z(alpha) = -97.7996, Truncation lag parameter = 3,

p-value = 0.01

alternative hypothesis: stationary

Warning message:

In pp.test(ydif) : p-value smaller than printed p-value

61

• After the first order difference, the series became stationary. We don’t need the second difference. Model identification and estimation can be done on the first order differenced series.

• You don’t need to use ADF and PP test at the same time. Both of them are unit root tests. If you don’t want to determine the order of lags during testing, use just PP test.