[R-SIG-Finance] Testing for cointegration: Johansen vs Dickey-Fuller

Paul Teetor paulteetor at yahoo.com
Tue Jan 13 22:15:41 CET 2009


All:

I want to thank Eric, Zeno, and Bernhard for continuing and expanding this
thread.  I am learning more with each post, and I am certain others are
profiting, too.  Soon we will have enough material for a small monograph!

Eric:  I want to clarify something.  The original post was testing a spread
for mean reversion.  The spread was between two futures and did not involve
any spot data (10-year Treasury Note versus 10-year Swap Rate).  These
futures have a shifting economic relationship unlike spot and futures
prices.  I cannot assume the spread is mean-reverting like a basis spread,
so the unit root test is important.

Everyone:  In case anyone wants to expore the concepts in this thread, I
have posted the original time series to my web site:

	http://quanttrader.info/public/ty.sr.csv

This is a CSV file which you can load directly into R using

	sprd <- read.csv("http://quanttrader.info/public/ty.sr.csv")

(Note to students of the futures market:  The data are not pure contract
prices.  These are synthetic series constructed through blending and
concatenation.)

Paul 

-----Original Message-----
From: Eric Zivot [mailto:ezivot at u.washington.edu] 
Sent: Tuesday, January 13, 2009 11:40 AM
To: Adams, Zeno
Cc: Brian G. Peterson; markleeds at verizon.net; Paul Teetor;
r-sig-finance at stat.math.ethz.ch
Subject: Re: AW: [R-SIG-Finance] Testing for cointegration:
JohansenvsDickey-Fuller

Zeno
I should have read the original post more carefully. I didn't realize that
the cointegrating vector used in the ADF procedure was first estimated by
OLS. Thanks for pointing this important mistake out. If this is the case,
then the procedure is the traditional Engle-Granger two-step procedure and
the asymptotic distn of the "ADF test statistic" follows the distribution
described by Phillips and Ouliaris (see Hamilton's Time Series Analysis book
for a description of this disn or my chapter on cointegration in MFTS).
Under the null of no-cointegration (unit root) this distribution
incorporates the fact that the estimated cointegrating relationship is
spurious and is similar to the Johansen distn. In this case, the
Engle-Granger and Johansen procedures may give different results if the OLS
cointegrating vector is quite a bit different than the cointegrating vector
estimated by the Johansen MLE. 
The Johansen MLE can sometime give very strange results. One reason for this
is that the finite sample distn of the Johansen MLE does not have any
moments (as proved by Peter Phillips in a Journal of Econometrics article)
and so the tails of the finite sample distn are very fat which can produce
extreme values of the cointegrating vector. This is similar to the situation
with the LIML estimator in the traditional simultaneous equation model (the
2SLS estimator has moments in overidentified models; the LIML estimator does
not). 
Still, my original post is still relevant here. In an arbitrage situation
with spot and futures you should know the cost of carry relationship and so
there should be no need to estimate the cointegrating vector.


****************************************************************
*  Eric Zivot                  			               *
*  Professor and Gary Waterman Distinguished Scholar           *
*  Department of Economics                                     *
*  Adjunct Professor of Finance                                *
*  Adjunct Professor of Statistics
*  Box 353330                  email:  ezivot at u.washington.edu *
*  University of Washington    phone:  206-543-6715            *
*  Seattle, WA 98195-3330                                      *
*
*  www:  http://faculty.washington.edu/ezivot                  *
****************************************************************

On Tue, 13 Jan 2009, Adams, Zeno wrote:

> I would like to comment on what Eric wrote:
>
>
> "When you do the ADF procedure, you are imposing a known cointegrating 
> vector and so all of the uncertainty associated with estimating the 
> cointegrating vector has been eliminated. When you use the Johansen 
> framework, you are estimating the cointegrating vector and so the 
> uncertainty associated with this estimation is incorporated in the test."
>
>
> From what I understand the ADF procedure is the Engle-Granger 
> approach. However, I don't think that the "uncertainty associated with
estimating the cointegrating vector" has been eliminated since as Paul wrote
the sprd = ty - (1.2534 * sr) has been estimated by OLS. The spread is the
residual in the Engle-Granger procedure so testing the residual (which
itself is the outcome of an estimation involving uncertainty) on a unit root
requires higher critical values (the MacKinnon 1991 tables). Therefore, in
my opinion, Paul should compare the test statistic of his ADF test with the
higher MacKinnon 1991 values in order to conclude if, from a technical point
of view, the two variables are cointegrated or not.
>
> From the theoretical point of view I would of course agree with what Eric
wrote.
>
>
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: r-sig-finance-bounces at stat.math.ethz.ch 
> [mailto:r-sig-finance-bounces at stat.math.ethz.ch] Im Auftrag von Eric 
> Zivot
> Gesendet: Montag, 12. Januar 2009 19:39
> An: 'Brian G. Peterson'; markleeds at verizon.net; 'Paul Teetor'
> Cc: r-sig-finance at stat.math.ethz.ch
> Betreff: Re: [R-SIG-Finance] Testing for cointegration: 
> JohansenvsDickey-Fuller
>
>
> There are statistical issues associated with this problem that can 
> help explain what is going on. When you do the ADF procedure, you are 
> imposing a known cointegrating  vector and so all of the uncertainty 
> associated with estimating the cointegrating vector has been 
> eliminated. When you use the Johansen framework, you are estimating 
> the cointegrating vector and so the uncertainty associated with this
estimation is incorporated in the test.
> With the futures example, you know the cointegrating vector (if it 
> exists) from theory so it makes sense to impose it. The resulting test 
> will have more power (ability to reject the null when the alternative 
> is true) than the Johansen test. Both tests have no-cointegration as 
> the null (a unit root). So your ability to find cointegration with the 
> ADF test can be attributed to the fact that the ADF test has higher 
> power than the Johansen test in this context.
>> From a more general perspective, the arbitrage relationship between 
>> spot and
> futures implies that the basis cannot have a unit root so it is 
> essentially irrelevant to do a unit root test. What is more important 
> here is to understand the dynamic behavior of the "cointegrating 
> error". More than likely it will probably have some nonlinear effects 
> that may make it look nonstationary. There is a rather big literature 
> on threshold type effects in these models. See, for example, some of the
early papers by Martin Martens.
> PS. I don't think that the 2nd edition of Bernhard's cointegration 
> book discusses this issue in any detail.
>
>
> -----Original Message-----
> From: r-sig-finance-bounces at stat.math.ethz.ch
> [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Brian G.
> Peterson
> Sent: Friday, January 09, 2009 2:23 PM
> To: markleeds at verizon.net; Paul Teetor
> Cc: r-sig-finance at stat.math.ethz.ch
> Subject: Re: [R-SIG-Finance] Testing for cointegration: Johansen 
> vsDickey-Fuller
>
> I'll look when I get home, but if I recall correctly, you need to 
> check the unit root first.  Bernhard's book is definitely the best 
> reference, and the new edition expands substantially onn the previous
version.
>
> markleeds at verizon.net wrote:
>
>>  i think this can happen quite often but i'm not clear on how to 
>> resolve it. with the DF methodology, you are specifying the response 
>> and with Johansen's you aren't so that may have something to do with 
>> it. The literature talks about it but I don't think there's a 
>> resolution. Bernhard's cointegration book may talk about it also.
>>
>>
>>
>> On Fri, Jan 9, 2009 at  4:38 PM, Paul Teetor wrote:
>>
>>> R SIG Finance readers:
>>>  I am checking a futures spread for mean reversion.  I am using the 
>>> Johansen test (ca.jo) for cointegration and the Augmented 
>>> Dickey-Fuller test
>>> (ur.df)
>>> for mean reversion.
>>>
>>> Here is the odd part:  The Johansen test says the two futures prices 
>>> are not cointegrated, but the ADF test says the spread is, in fact, 
>>> mean-reverting.
>>>  I am very puzzled.  The spread is a linear combination of the 
>>> prices, and the ADF test says it is mean-reverting.  But the failed 
>>> Johansen test says the prices are not cointegrated, so no linear 
>>> combination of prices is mean-reverting.  Huh??
>>>  I would be very grateful is someone could suggest where I went 
>>> wrong, or steer me towards some relevent reference materials.
>>>
>>>  Background:  I am studying the spread between TY futures (10-year 
>>> US
>>> Treasurys) and SR futures (10-year US swap rate), calculated as:
>>>      sprd = ty - (1.2534 * sr)
>>>  where ty and sr are the time series of futures prices.  (The 1.2534 
>>> factor is from an ordinary least squares fit.)  I execute the 
>>> Johansen procedure this way:
>>>      ca.jo(data.frame(ty, sr), type="eigen", ecdet="const")  The 
>>> summary of the test result is:
>>>
>>> 	###################### 	# Johansen-Procedure #
>>> ######################
>>> 	Test type: maximal eigenvalue statistic (lambda max) , without
>>> linear trend and constant in 	cointegration
>>> 	Eigenvalues (lambda):
>>> 	[1]  2.929702e-03  6.616599e-04 -1.001412e-17
>>>
>>> 	Values of teststatistic and critical values of test:
>>>
>>> 	         test 10pct  5pct  1pct
>>> 	r <= 1 | 2.00  7.52  9.24 12.97
>>> 	r = 0  | 8.89 13.75 15.67 20.20
>>>
>>> 	<snip>
>>>
>>> I interpret the "r <= 1" line this way:  The test statistic for r <=
>>> 1 is below the critical values, hence we cannot reject the null 
>>> hypothesis that the rank is less than 2.  We conclude that the two 
>>> time series are not cointegrated.
>>>
>>> I run the ADF test this way:
>>>
>>> 	ur.df(sprd, type="drift")
>>>
>>> (I set type="drift" because that seems to correspond to ecdet="const"
>>> for
>>> the Johansen test.)  The summary of the ADF test is:
>>>
>>> 	###############################################
>>> 	# Augmented Dickey-Fuller Test Unit Root Test # 
>>> ###############################################
>>>
>>> 	Test regression drift
>>>
>>> 	<snip>
>>>
>>> 	Value of test-statistic is: -2.9624 4.4142
>>>
>>> 	Critical values for test statistics:
>>> 		1pct  5pct 10pct
>>> 	tau2 -3.43 -2.86 -2.57
>>> 	phi1  6.43  4.59  3.78
>>> I interpret the test statistics as meaning we can reject the null 
>>> hypothesis of a unit root (at a confidence level of 90% or better), 
>>> hence the spread is mean-reverting.  I get similar results from the
>>> adf.test() procedure.
>>>
>>> F.Y.I., I am running version 2.6.2 of R.
>>>  Paul Teetor
>>> Elgin, IL   USA
>>>
>>> _______________________________________________
>>> R-SIG-Finance at stat.math.ethz.ch mailing list 
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>>> -- Subscriber-posting only.
>>> -- If you want to post, subscribe first.
>>
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list 
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
>
> EBS European Business School gemeinnuetzige GmbH - Sitz der 
> Gesellschaft: Wiesbaden, Amtsgericht Wiesbaden HRB 19951 - 
> Umsatzsteuer-ID DE 113891213 Geschaeftsfuehrung: Prof. Dr. Christopher 
> Jahns, Rektor; Dr. Reimar Palte, Kanzler;  Sabine Fuchs, Prokuristin; 
> Verwaltungsrat: Dr. Hellmut K. Albrecht, Vorsitzender



More information about the R-SIG-Finance mailing list