model identificationzhu/ams586/model_selection.pdf · 2016. 3. 3. · model identification 1 ....

104
MODEL IDENTIFICATION 1

Upload: others

Post on 18-Mar-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

MODEL IDENTIFICATION

1

Page 2: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

Stationary Time Series

2

Page 3: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

Wold’ Theorem

• Wold’s decomposition theorem states that a stationary time series process with no deterministic components has an infinite moving average (MA) representation. This in turn can be represented by a finite autoregressive moving average (ARMA) process.

• Therefore, by examining the first and second order moments, we can identify a stationary process.

3

Page 4: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

Non-Stationary Time Series

4

Page 5: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

NON-STATIONARY TIME SERIES MODELS

• Non-constant in mean

• Non-constant in variance

• Both

5

Page 6: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

NON-STATIONARITY IN MEAN

• Deterministic trend

– Detrending

• Stochastic trend

– Differencing

6

Page 7: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC TREND

• A deterministic trend is when we say that the series is trending because it is an explicit function of time.

• Using a simple linear trend model, the deterministic (global) trend can be estimated. This way to proceed is very simple and assumes the pattern represented by linear trend remains fixed over the observed time span of the series. A simple linear trend model:

7

tt atY

Page 8: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC TREND

• The parameter measure the average change in Yt from one period to the another:

• The sequence {Yt} will exhibit only temporary departures from the trend line +t. This type of model is called a trend stationary (TS) model.

8

t

ttttt

YE

aattYYY 11 1

Page 9: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

EXAMPLE

9

Page 10: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

TREND STATIONARY

• If a series has a deterministic time trend, then we simply regress Yt on an intercept and a time trend (t=1,2,…,n) and save the residuals. The residuals are detrended series. If Yt is trend stationary, we will get stationary residual series. If Yt is stochastic, we do not necessarily get stationary series.

10

Page 11: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC TREND

• Many economic series exhibit “exponential trend/growth”. They grow over time like an exponential function over time instead of a linear function.

• For such series, we want to work with the log of the series:

11

t

tt

YE

atY

ln

: is rategrowth average theSo

ln

Page 12: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

STOCHASTIC TREND

• The ARIMA models where the difference

order ≥ 1 (that is, such series has at least one unit root) is a typical time series that has stochastic trend.

• Such series is also called difference stationary – in contrast to trend stationary.

12

Page 13: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

STOCHASTIC TREND

• Recall the AR(1) model: Yt = c + Yt−1 + at.

• As long as || < 1, it is stationary and everything is fine (OLS is consistent, t-stats are asymptotically normal, ...).

• Now consider the extreme case where = 1, i.e.

Yt = c + Yt−1 + at.

• Where is the trend? No t term.

13

Page 14: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

STOCHASTIC TREND

• Let us replace recursively the lag of Yt on the right-hand side:

14

t

ii

ttt

ttt

aYtc

aaYcc

aYcY

10

12

1

Deterministic trend

• This is what we call a “random walk with drift”. If c = 0, it is a “random walk”.

Page 15: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

STOCHASTIC TREND

• Each ai shock represents shift in the intercept. Since all values of {ai} have a coefficient of unity, the effect of each shock on the intercept term is permanent.

• In the time series literature, such a sequence is said to have a stochastic trend since each ai shock imparts a permanent and random change in the conditional mean of the series. To be able to define this situation, we use Autoregressive Integrated Moving Average (ARIMA) models.

15

Page 16: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC VS STOCHASTIC TREND

• They might appear similar since they both lead to growth over time but they are quite different.

• To see why, suppose that through any policies, you got a bigger Yt because the noise at is big. What will happen next period?

– With a deterministic trend, Yt+1 = c +(t+1)+at+1. The noise at is not affecting Yt+1. Your policy had a one period impact.

– With a stochastic trend, Yt+1 = c + Yt + at+1 = c + (c + Yt−1 + at) + at+1. The noise at is affecting Yt+1. In fact, the policy will have a permanent impact.

16

Page 17: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC VS STOCHASTIC TREND

Conclusions: – When dealing with trending series, we are always

interested in knowing whether the growth is a deterministic or stochastic trend.

– There are also economic time series that do not grow over time (e.g., interest rates) but we will need to check if they have a behavior ”similar” to stochastic trends ( = 1 instead of || < a, while c = 0).

– A deterministic trend refers to the long-term trend that is not affected by short term fluctuations in the series. Some of the occurrences are random and may have a permanent effect of the trend. Therefore the trend must contain a deterministic and a stochastic component.

17

Page 18: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC TREND EXAMPLE

Simulate data from let’s say AR(1):

>x=arima.sim(list(order = c(1,0,0), ar = 0.6), n = 100)

Simulate data with deterministic trend

>y=2+time(x)*2+x

>plot(y)

18

Page 19: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC TREND EXAMPLE > reg=lm(y~time(y))

> summary(reg)

Call:

lm(formula = y ~ time(y))

Residuals:

Min 1Q Median 3Q Max

-2.74091 -0.77746 -0.09465 0.83162 3.27567

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) 2.179968 0.250772 8.693 8.25e-14 ***

time(y) 1.995380 0.004311 462.839 < 2e-16 ***

---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.244 on 98 degrees of freedom

Multiple R-squared: 0.9995, Adjusted R-squared: 0.9995

F-statistic: 2.142e+05 on 1 and 98 DF, p-value: < 2.2e-16

19

Page 20: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC TREND EXAMPLE

> plot(y=rstudent(reg),x=as.vector(time(y)), ylab='Standardized

Residuals',xlab='Time',type='o')

20

Page 21: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC TREND EXAMPLE

> z=rstudent(reg)

> par(mfrow=c(1,2))

> acf(z)

> pacf(z)

21

De-trended series

AR(1)

Page 22: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

STOCHASTIC TREND EXAMPLE

Simulate data from ARIMA(0,1,1):

> x=arima.sim(list(order = c(0,1,1), ma = -0.7), n = 200)

> plot(x)

> acf(x)

> pacf(x)

22

Page 23: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

AUTOREGRESSIVE INTEGRATED MOVING AVERAGE (ARIMA) PROCESSES

• Consider an ARIMA(p,d,q) process

23

.0,WN~ and

rootscommon no share 1

and 1 where

1

2a

1

1

0

t

qqq

ppp

tqt

d

p

a

BBB

BBB

aBYBB

Page 24: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ARIMA MODELS

• When d=0, 0 is related to the mean of the process.

• When d>0, 0 is a deterministic trend term.

– Non-stationary in mean:

– Non-stationary in level and slope:

24

.1 10 p

tqtp aBYBB 01

tqtp aBYBB 0

21

Page 25: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

RANDOM WALK PROCESS

• A random walk is defined as a process where the current value of a variable is composed of the past value plus an error term defined as a white noise (a normal variable with zero mean and variance one).

• ARIMA(0,1,0) PROCESS

25

.,0~ where

1

2

1

at

tttttt

WNa

aYBYaYY

Page 26: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

RANDOM WALK PROCESS

• Behavior of stock market.

• Brownian motion.

• Movement of a drunken men.

• It is a limiting process of AR(1).

26

Page 27: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

RANDOM WALK PROCESS

• The implication of a process of this type is that the best prediction of Y for next period is the current value, or in other words the process does not allow to predict the change (YtYt-1). That is, the change of Y is absolutely random.

• It can be shown that the mean of a random walk process is constant but its variance is not. Therefore a random walk process is nonstationary, and its variance increases with t.

• In practice, the presence of a random walk process makes the forecast process very simple since all the future values of Yt+s for s > 0, is simply Yt.

27

Page 28: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

RANDOM WALK PROCESS

28

Page 29: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

RANDOM WALK PROCESS

29

Page 30: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

RANDOM WALK WITH DRIFT

• Change in Yt is partially deterministic and partially stochastic.

• It can also be written as

30

t

Y

tt aYY

t

01

trendstochastic

1

trendticdeterminis

00

t

iit atYY Pure model of a trend

(no stationary component)

Page 31: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

RANDOM WALK WITH DRIFT

31

00 tYYE t

After t periods, the cumulative change in Yt is t0.

flatnot 0 sYYYE ttst

Each ai shock has a permanent effect on the mean of Yt.

Page 32: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

RANDOM WALK WITH DRIFT

32

Page 33: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ARIMA(0,1,1) OR IMA(1,1) PROCESS

• Consider a process

• Letting

33

.,0~ where

11

2at

tt

WNa

aBYB

tt YBW 1

stationaryaBW tt 1

Page 34: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ARIMA(0,1,1) OR IMA(1,1) PROCESS

• Characterized by the sample ACF of the original series failing to die out and by the sample ACF of the first differenced series shows the pattern of MA(1).

• IF:

34

.1 where11

t

jjt

j

t aYY

1

121 1,,

jjt

jttt YYYYE

Exponentially decreasing. Weighted MA of its past values.

Page 35: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ARIMA(0,1,1) OR IMA(1,1) PROCESS

35

,,1,, 2111 ttttttt YYYEYYYYE

where is the smoothing constant in the method of exponential smoothing.

Page 36: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

REMOVING THE TREND

• A series containing a trend will not revert to a long-run mean. The usual methods for eliminating the trend are detrending and differencing.

36

Page 37: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETRENDING

• Detrending is used to remove deterministic

trend.

• Regress Yt on time and save the residuals.

• Then, check whether residuals are stationary.

37

Page 38: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DIFFERENCING

• Differencing is used for removing the stochastic trend.

• d-th difference of ARIMA(p,d,q) model is stationary. A series containing unit roots can be made stationary by differencing.

• ARIMA(p,d,q) d unit roots

38

Integrated of order d, I(d)

dIYt ~

Page 39: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DIFFERENCING

• Random Walk:

39

ttt aYY 1

tt aY

Non-stationary

Stationary

Page 40: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

KPSS TEST

• To be able to test whether we have a deterministic trend vs stochastic trend, we are using KPSS (Kwiatkowski, Phillips, Schmidt and Shin) Test (1992).

40

stationary difference 1~:

stationary or trend level0~:

1

0

IYH

IYH

t

t

Page 41: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

KPSS TEST

STEP 1: Regress Yt on a constant and trend and construct the OLS residuals e=(e1,e2,…,en)’.

STEP 2: Obtain the partial sum of the residuals.

STEP 3: Obtain the test statistic

where is the estimate of the long-run variance of the residuals.

41

t

iit eS

1

n

t

tSnKPSS

12

22

2

Page 42: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

KPSS TEST

• STEP 4: Reject H0 when KPSS is large, because that is the evidence that the series wander from its mean.

• Asymptotic distribution of the test statistic uses the standard Brownian bridge.

• It is the most powerful unit root test but if there is a volatility shift it cannot catch this type non-stationarity.

42

Page 43: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DETERMINISTIC TREND EXAMPLE kpss.test(x,null=c("Level"))

KPSS Test for Level Stationarity

data: x

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

Warning message:

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

p-value

> kpss.test(x,null=c("Trend"))

KPSS Test for Trend Stationarity

data: x

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

Warning message:

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

p-value

43

Here, we have deterministic trend or trend stationary process. Hence, we

need de-trending to work with stationary series.

Page 44: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

STOCHASTIC TREND EXAMPLE > kpss.test(x, null = "Level")

KPSS Test for Level Stationarity

data: x

KPSS Level = 3.993, Truncation lag parameter = 3, p-value = 0.01

Warning message:

In kpss.test(x, null = "Level") : p-value smaller than printed p-

value

> kpss.test(x, null = "Trend")

KPSS Test for Trend Stationarity

data: x

KPSS Trend = 0.6846, Truncation lag parameter = 3, p-value = 0.01

Warning message:

In kpss.test(x, null = "Trend") : p-value smaller than printed p-

value

44

Here, we have stochastic trend or difference stationary process. Hence, we

need differencing to work with stationary series.

Page 45: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

PROBLEM

• When an inappropriate method is used to eliminate the trend, we may create other problems like non-invertibility.

• E.g.

45

. and circleunit

theoutside are 0 of roots thewhere

stationary Trend10

tt

tt

aB

B

tYB

Page 46: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

PROBLEM

• But if we misjudge the series as difference stationary, we need to take a difference. Actually, detrending should be applied. Then, the first difference:

46

tt BYB 11

Now, we create a non-invertible unit root process in the MA component.

Page 47: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

NON-STATIONARITY IN VARIANCE

• We will learn more about this in the future.

• For now, we will only learn the variance stabilizing transformation.

47

Page 48: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

VARIANCE STABILIZING TRANSFORMATION

• Generally, we use the power function

48

1964) Cox, and(Box 1

t

t

YYT

Transformation

1 1/Yt

0.5 1/(Yt)0.5

0 ln Yt

0.5 (Yt)0.5

1 Yt (no transformation)

Page 49: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

VARIANCE STABILIZING TRANSFORMATION

• Variance stabilizing transformation is only for positive series. If your series has negative values, then you need to add each value with a positive number so that all the values in the series are positive. Now, you can search for any need for transformation.

• It should be performed before any other analysis such as differencing.

• Not only stabilize the variance but also improves the approximation of the distribution by Normal distribution.

49

Page 50: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

Box-Cox TRANSFORMATION

install(TSA)

library(TSA)

oil=ts(read.table('c:/oil.txt',header=T), start=1996, frequency=12)

BoxCox.ar(y=oil)

50

Page 51: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

Unit Root Tests

51

Page 52: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

52

Page 53: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

53

Page 54: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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)

54

Page 55: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

55

Page 56: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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 without 0 gives different results.

.,0_~ where 2

10

at

ttt

WNNormala

aYY

56

Page 57: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DF TEST

• Consider the hypothesis

• The hypothesis is the reverse of KPSS test.

0~1:

1~1:

1

0

IYH

IYH

t

t

57

Page 58: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DF TEST

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

• If =0, system has a unit root.

58

ttt

tttt

aYY

aYYY

10

101 1

0

0

1

0

:H

:H

Page 59: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DF TEST

• DF (1979)

59

trendelinear tim a anddrift addsY

driftRW with Y

RW Pure

110t

10t

1

tt

tt

ttt

aYt

aY

aYY

Page 60: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

60

ˆ..

1ˆ1

est

.1,0ˆ 2 Nnd

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

Page 61: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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. 61

ttt aYY 10

mean withI~Y:H

drift withoutI~Y,:H

t1

t

01

101 00

Page 62: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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:

62

Page 63: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

DF TEST • With constant and trend term

The test regression is

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

63

ttt aYtY 10

trend time ticdeterminis withIYH

drift withIYH

t1

t

0~1:

1~0,1:0

Page 64: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

64

Page 65: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

65

Page 66: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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. H1: Yt∼I(1)

• We would continue to test for a further unit root

until we rejected H0.

66

Page 67: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

67

Page 68: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

68

root. unit a contain mayBBB and

aE with,WN~a where

aYB

ppp

tat

ttp

1

42

0

1

0

Page 69: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ADF TEST

• To test for a unit root, we assume that

69

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 70: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ADF TEST

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

70

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 71: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ADF TEST

• Hypothesis

71

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 72: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ADF TEST

• The limiting distribution of the test statistic

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

72

11ˆ pn

Page 73: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

73

Page 74: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

74

Page 75: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

75

4/1

max100

12n

p

Page 76: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ADF TEST

• EXAMPLE: n=54

Examine 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.

76

ttttt aYYYY 221110

2

1369.01

1353.01

08699.097.87326.0141.0856.0139 tttt YYYY

:equation OLS

Page 77: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ADF TEST

• EXAMPLE (contd.) Under H0,

77

.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 78: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

78

Page 79: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ADF TEST

• Ensuring that at is approximately WN

79

tt

nk whereB

q

ptqtp aY

B

BaBYB

k

3

Page 80: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

80

Page 81: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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)

81

ttt aYY 10

ttt aYY :equation test PP 10

Page 82: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

PP TEST

• The hypothesis to be tested:

82

0:

0:

1

0

H

H

Page 83: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

83

n

22

22

ˆ2

2

ˆ

ˆ..

ˆ

ˆˆ

2

1

ˆ

ˆ

esntZt

22

2

2

ˆˆˆ

ˆ..

2

esnnZ

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 84: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

84

Page 85: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

85

Page 86: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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).

86

Page 87: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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%!)

87

Page 88: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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!

88

Page 89: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

89

Page 90: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

STRUCTURAL BREAKS

Consider 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 .

90

Page 91: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

91

Simulated unit root and trend stationary processes with structural break.

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

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

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

Page 92: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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.

92

Page 93: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

2016/3/3 93

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 2

1

p

t t L i t i t

i

y a a y a t D y

Page 94: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

EXAMPLE

• Consider following time series plots

94

Page 95: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

95

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

series.

Page 96: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

96

Page 97: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

ADF TEST RESULT

• To decide the lag order

97

Page 98: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

98

Unit root test with no drift

Unit root test with drift

Page 99: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

99

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 100: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

100

No need after getting the above result.

Page 101: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

101

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 102: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

102

Page 103: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

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

103

• 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.

Page 104: MODEL IDENTIFICATIONzhu/ams586/Model_Selection.pdf · 2016. 3. 3. · MODEL IDENTIFICATION 1 . Stationary Time Series 2 . Wold’ Theorem ... turn can be represented by a finite autoregressive

Reference

• For a further comparison of the Unit Root Tests:

• http://www.bankofengland.co.uk/education/Documents/ccbs/handbooks/pdf/ccbshb22.pdf

• Our thanks go to Professor CEYLAN YOZGATLIGIL as this lecture is largely based on her notes for applied time series analysis!

104