Unit Root Time Series - Booth School of...

28
1 Unit Root Time Series Univariate random walk Consider the regression The least squares estimate of 1 is: 2 1 1 where ~ 0, t t t t y y iid N 1 1 1 1 1 2 2 1 1 1 ˆ 1 T T t t t t t t T T t t t t yy yy T y y T

Transcript of Unit Root Time Series - Booth School of...

1

Unit Root Time Series

Univariate random walk

• Consider the regression

• The least squares estimate of 1 is: 

21 1 where ~ 0,t t t ty y iid N

1 11 1

12 2

1 1

1

ˆ1

T T

t t t tt t

T T

t tt t

y y y yT

y yT

2

Now what if =1

• If                       then let y0=0 so that

• If                                 then 

• The denominator of the least squares estimate is

1t t ty y 1

t

t jj

y

2

2 2 2 221 1 2 1 2 3 1 2

1 1 1

2

1

1 1 1... ...

11 cross product terms

t

T T t

t j Tt t j

y

T

tt

yT T T

T tT

2~ 0,t iid N 2~ 0,ty N t

So 

The variance of yt depends on T and explodes. 

2 2 2

1 1 1

2

1

22

1 1 11 1

1

1 1

2 2

T T T

t tt t t

T

t

E y T t E T tT T T

tT

T T T

T

3

What about the numerator?

• We have:

so

Note:

or 

1 1 1t t t t ty y y y

1 1 11

21 1

11

T T

t t t t tt t

T

t t tt

y y y yy y

22 2 21 1 12t t t t t t ty y y y

2 2 2 21 1

1

2 2 2 2 2 2 21 1 1

21 1

1 1 1

1

1

1

2

1 1

2 2

T

t t t tt

T T T T

t t t

T

t

t t T

t

tt t t t

tt

y y y

y y y y

y y

y

2 2 21 1

1

2t t t t ty y y

• Hence:

• Multiplying the last term by

2 2 21 1

1 1 1

1 1 1

2

T T T

t t t T tt t t

y y y yT T T

222 2

1 1 2 21 1 1

1 1 1

2

T T TT

t t t tt t t

yy y y

T T T T

2

2

4

• Since

• So  

2

2 22

~ (0, ), ~ 1Tt

yy N t

T

22

1

11

T

tp

tT

2

2 21 1

1 1

1 11 1

2

T T

t t tt t

y y yT T

• We’ve shown:

so

2

21

11

2 2 2

1 1 1

22 2

1

11 1

2ˆ 11 1 1

11 1

2

T

t tt

T T T

t t tt t t

T

tt

y yT

y y yT T T

yT

2

21

1

2

1

1 11 1

2

T T

tt t

t tyT

y yT

5

1. The numerator converges to a well defined distribution.  However the denominator grows with T since we already saw

2 2

1

11

2

T

tt

TE y

T

22

12

1

1 12ˆ 1

1 TD

tt

yT

• Normally for the least squares estimator we would multiply by root T and get that                  converges to a well defined distribution.  But that does not work here:

since

ˆ 1T

2

2 22 2

12

1 1

1 1 1 12

1 12ˆ 1 0

1 T

t tt

T

t

TT

yT T

yT

2 2

1

21 1

2

1

2

T

tt

T

TT

TE y

T

6

2. Interestingly the rate of convergence of the least squares estimate is faster that root T!

3. However,                 has a chi‐squared distribution in the numerator, and a denominator that doesn’t explode (but we don’t know the actual distribution yet).  

What does the denominator converge to?

1̂ 1T

Brownian Motion

The standard Brownian Motion is a continuous‐time stochastic process associating each date               with the scalar W(t) such that:

• W(0)=0

• For any dates                                 the changes 

are independent Gaussian with  

0,1t

1 20 ... 1kt t t

2 1 3 2 1, ,..., k kW t W t W t W t W t W t

~ 0,W s W t N s t

7

The Functional CLT

• Basic CLT says that if t is iid mean zero and variance 2:

where

• Consider an estimator that only uses the first half of the data set  

• The CLT still applies so that    

20,TD

T N

1

1 T

T ttT

2

212

1 T

T tTt

222 0,T

DT N

• More generally, let r be any number between 0 and 1.

• Let

• Let’s call XT(r) the “scaled partial sum”

• Then by the CLT

or and

or

1

1 Tr

T ttX r

T

1

1 1 Tr

T ttX r

r Tr

20,TD

T X r N r

0,TD

TX r N r

20,TD

TrX r N

r

20,TD

TX r N

r

8

Functional Central Limit Theorem (FCLT)

• If we consider a sample using observations Tr1to Tr2 for r2>r1 then

• It shouldn’t be surprising that  

• The fact that                       result is known as the functional CLT.

2 1 2 10,T TD

TX r X r N r r

TD

TX W

T

TX W

Continuous Mapping Theorem (CMT)

• Let g be a continuous functional and let

, then                            .

For example we have 

So

Or  

TD

S S TD

g S g S

TD

TX W

T TD

TX T X W

2 2

TD

T X W

9

Back to our random walk regression:

• If                       then                and let y0=0.

• Let 

• This is just a step function.

• is, as before, the sum of Tr iid rv’s.

1t t ty y 1

t

t tt

y

1

0 for 0 1

for 1 2

for 1

T

T

r T

y T T r TX r

y T r

TX r

• The integral of the step function is the sum of the rectangles, each of width 1/T so:

• Or 

1

210

T tT t

yX r dr

T

1 3

121

2

0

T tt

T

T ttT

y

Tr dr TX T y

10

• But we know

• So by the CMT 

• So 

TT X r W r

1 1

0 0TT X r dr W r dr

13 2

1 0

T

tt DT y W r dr

• We need to figure out the distribution of the sum of the squared y’s (the denominator).

• Let 

21

2

0 for 0 1

for 1 2

for 1

T

T

r T

y T T r TS r

y T r

2

( )T TS r T X r

11

• Then

• And from the CMT and the FCLT

• Which means   

1 2 2

10

T

T ttS r dr y T

1 1 22

0 0TS r dr W r dr

1 22 2 2

1 0

T

tty T W r dr

• We worked out previously:

• We now know that for the denominator

• So multiplying the top result by T on both sides yields

22

12

1

1 12ˆ 1

1 T

tt

yT

1 22 2 2

1 0

T

tty T W r dr

12

• So,

22 2

1 1 12 22

0 0

11 1 1 1

2 2ˆ 1TW r dr W r dr

22

12

21

1 12ˆ 1

1 T

tt

Ty

T

1 22

0W r dr

• The probability that a Chi‐squared(1) random variable is less than unity is 68%.  So 68% of the time, the estimated slope value of a random walk is less than 1.  

• Also, if the squared Normal in the numerator is large, then the square of the denominator will tend to be large as well meaning that the distribution will be negatively skewed.

• This is called the Dickey‐Fuller distribution.  

13

• Some examples in EViews

What about regressing one random walk on another random walk?

• Generally, a non‐stationary process added to a non‐stationary process yields a non‐stationary process.

• A stationary process added to a stationary process yields a stationary process.

14

Spurious Regression

• Generally speaking (an exception will follow) it’s a bad idea to regress one unit root process on another unit root process.

• That is, if yt and xt both follow independent random walks. 

• And we run the regression:

1

101 222

2 01

ˆ1

T t tt x y y x

Tx xtt

y xW r W r dr

T T

W r drxT

t t ty x u

21 0 where y 0 and ~ 0,y y

t t t t yy y N

21 0 where x 0 and ~ 0,x x

t t t t xx x N and independent.x x

t t

• This has expectation zero since the numerator is expectation zero and the denominator is a positive number.

• But the estimate does not converge to any number!  It is a random draw from a distribution that doesn’t depend on T! 

1

10

1 22

2 01

ˆ1

T t tt y y x

Tx xtt

y xW r W r drT T

W r drxT

15

• Simulations and regressions from random walk models.

• Generally, we don’t regress one random walk on another random walk, instead, we work with the differenced series instead of levels.

• That is if the two series x and y follow a random walk, then take the first difference and model the differences in the series. 

• Regressing stationary series on stationary series – no problem.

01

pt

t j t tjt

y

x

y β β y v

16

• Cointegration is a special relationship that two non‐stationary series can exhibit.  

• Sometimes a pair of series might each follow a random walk, but over the long run their paths are tied together.  

• While they wander around over time, the two series can’t get far apart. 

Cointegration

• Bid/Ask example.

• Tomato example.

• The $/Euro exchange rate and the price of converting from $/Yen and then from Yen/$.

17

Price of tomatoes per pound

Bid and Ask prices

17.1

17.2

17.3

17.4

17.5

17.6

17.7

17.8

250 500 750 1000 1250 1500 1750

ASK BID

18

Formal Definition of Cointegration

The series yt and xt are said to be cointegrated if both yt and xt have a unit root but there exists a linear combination 

where zt is covariance stationary i.e. doesn’t have a unit root.

describes the cointegrating relationship, often it is 1 (as in the preceding examples).

ttt xyz

A simple structural interpretation of Cointegration.

• Let pt be the fair market value of the asset at time t.

• Let       be the ask price at time t and         the bid price.

• The ask price should be slightly above the fair market value and the bid below.  

• The differences between the prices are compensation for the risk of leaving shares available (its basically an option contract).

atp b

tp

19

• We can write this as:

• So, t and t are payments received by those who post shares at the ask and bid.  It is compensation for risk, it’s the cost of being able to transact immediately (Zhang Russell Tsay 2007).

• It would be natural to think of  and  as mean revering processes.

• If the payments get large enough, new orders will be placed closer to the fair market value.

at t tp p bt t tp p

t

t

atp

btp

tp

• Notice then that:

• So while the ask and the bid are non‐stationary the difference between them is a stationary processes (actually the difference is the spread!) 

a bt t t t t t t tp p p p

20

Testing for Cointegration.  CASE 1, KNOWN COINTEGRATING RELATIONSHIP.

• First, test to see that both yt and xt have a unit root.

• Create sequence of

• Test the zt series using a standard Augmented Dickey Fuller test.

• If zt is stationary then x and y are cointegrated.

t t t

knownvalue

z y x

CASE 2:  UNKNOWN COINTEGRATING RELATIONSHIP 

1. Test to see that both yt and xt have a unit root.

2. Regress yt on xt and estimate .  Create the residual series

– These estimates of  turn out to not suffer from the spurious regression problem when x and y are cointegrated.  

1 1ˆ ˆ t t t t ty x z z y x

21

– This is the one time its OK to run this regression and in fact we get super consistent (rate T) convergence. 

3. Test to see if zt has a unit root. – We can’t use the standard Dickey Fuller because the estimation of  used to construct the z series messes things up.

– We must use another special distribution that is obtained from simulations.

• Eviews will perform this test for us. 

Bid ask prices

3.730

3.735

3.740

3.745

3.750

3.755

3.760

3.765

105

127

92

495

372

64

933

609

97

270

843

39

614

106

931

1815

129

521

4135

152

771

6427

175

731

8719

198

872

1061

221

912

3395

246

262

5806

269

052

7990

290

773

0120

311

503

2165

332

67

LASK LBID

22

Case 1: Create                 seriest t tz y x

.000

.001

.002

.003

.004

.005

.006

105

127

92

495

372

64

933

609

97

270

843

39

614

106

931

1815

129

521

4135

152

771

6427

175

731

8719

198

872

1061

221

912

3395

246

262

5806

269

052

7990

290

773

0120

311

503

2165

332

67

Z

Perform the Augmented Dickey Fuller Test

• Null is that z has a unit root which means that there is no cointegration.

• We reject the null that z has a unit root and conclude that the series x and y are cointegrated.

P-value

23

What about unkown cointegrating relationship?

• Estimate from data the value of  by least squares regression.  

• Perform “special” augmented Dickey Fuller.

Eviews Engle Granger Single Equation Test

There are twoways that the test can be donedepending on which variable is put on the left hand side.Each one has a p-valueI use the firstp-values here.

24

Error Correction Model (ECM)

• If yt and xt are cointegrated, then it must be the case that the model for yt and xt follows what is called the Error Correction Model ECM (this was proven in the original Engle Granger paper (Econometrica 1987)). 

• The model is specified as a VAR in changes in yt and xt , but it includes a special term on the right hand side.

Error Correction Model (ECM)

• If the xt and yt are cointegrated then you should fit an error correction model.  

• Since x and y follow a random walk, take the first difference of x and y. 

• Where                             is the error correcting term that is new in the VAR specification and             . 

• (recall that bold y is a vector, unbold y is not)

0 11 This is the

new partThis is the usual VAR(p)

.

pt

t j t j t tjt

part

yz

x

y β β y α v

t t tz y x 1

2

α

25

• So this is just a regular VAR model for the changes in x and y but it has the “error correction term” 

• Often  is 1, so this term tells us how to update changes in y and x as a function of the difference between y and x at time t.  

11

2t t tz y x

α

• Step 1) estimate cointegrating relationship via regression of yt on xt

• Step 2) create series

• Step 3) estimate error correction model, equation by equation.  zt would be an additional right hand side variable (exogenous). 

26

• If x and y are cointegrated then the correct model is the error correction model.

• If we simply fit a VAR on the changes, the model will be misspecified since we need both changes and levels on the right hand side of the equation.

• The fact that the VAR depends on zt‐1 allows the series to correct for misalignments –hence the term error correction.

• A simple error correction model for logarithmic bid and ask prices is given by:

where

• So 3 and 3 determine how the bid and ask prices change as we vary the spread.  These dictate whether the ask will rise or the bid will fall when the spreads get wide.

0 1 31 21

1 20 1 3

ln( ) ln( )

ln( ) ln( )t t t

tt t t

ask askSpd

bid bid

ln lnt t t tSpd z ask bid

27

• Market forces should force wide spreads to narrow.

• We should expect that a wide spread should lead to an increase in the bid and a decrease in the ask.  

• This is true empirically with 3 around ‐.15 and 3 around .15.  (we get a little larger values in our sample).

ECM VAR

28

• An additional variable xt‐1 can be included in the Error Correction Model.

• A by sell indicator (+1 for buy, ‐1 for sell)

• The (signed for buy or sell) size of the previous trade. 

• Multiple variables can be included.

0 1 3 31 21 1

1 20 1 3 3

ln( ) ln( )

ln( ) ln( )t t t

t tt t t

ask askSpd x

bid bid

• Buys tend to raise both the bid and the ask.

• Sells tend to decrease both the bid and the ask.

• However, the ask tends to raise by more than the bid following a buy and the bid tends to fall by more than the ask following a sell.  

• Trade size matters.  Larger trades have a larger price impact.  The effect increases at a decreasing rate.