Anda di halaman 1dari 8

# Cointegration101 1 SpiderFinancialCorp,2013

Cointegration

Intimeseriesanalysis,weoftenencountersituationswherewewishtomodelonenonstationarytime
series(
t
Y )asalinearcombinationofothernonstationarytimeseries(
1, 2, ,
, ,...,
t t k t
X X X ).Inother
words:

1 1, 2 2, ,
...
t o t t k k t t
Y X X X | | | | c = + + + + +
Ingeneral,aregressionmodelfornonstationarytimeseriesvariablesgivesspurious(nonsense)results.
Theonlyexceptionisifthelinearcombinationofthe(dependentandexplanatory)variableseliminates
thestochastictrendandproducesstationaryresiduals.
1 1, 2 2, ,
... ~ (0)
t t t k k t
Y X X X I + + + +
Inthiscase,werefertothesetofvariablesascointegrated.Itisonlyinthiscasethatwecanlookat
regressionasareasonableandreliablemodel.
Inthispaper,welldiscussoneimportantquestion:
1. HowdoweexamineasetofnonstationaryvariablesforCointegration?
Infutureissues,welltacklethetopicsoflongrunandshortrundynamicsofcointegratedtimeseries
variablesusingOLSregressionanderrorcorrectionmodels.
Motivation
Cointegrationmeansthat,whilemanydevelopmentscancausepermanentchangesintheindividual
variable(i.e.
, i t
x ),thereissomelongrunequilibriumrelationtyingtheindividualvariablestogether,
representedbysomelinearcombinationofthem.
Why do we care?
whichoccursifarbitrarilytrendingand/ornonstationaryseriesareregressedoneachother.
2. Inthecaseofnonstationarity(oftype (1) I ),theseriesevenwithouttrendtendstoshow
localtrends,whichtendtocomovealongforrelativelylongperiods.

Cointegration101 2 SpiderFinancialCorp,2013

strategiesarebasedonthebeliefthattwosecuritiesaresomewhatrelatedandalongrunequilibrium
shouldexistbetweenthem.
relationships,underthehypothesisofalongrunequilibriumbetweennonstationarytimeseries(e.g.
disposableincomevs.privateconsumptions).
Background
Inanutshell,cointegrationassumesthereisacommonstochasticnonstationary(i.e. (1) I )process
underlyingtwo(ormore)processesXandY.

1
1
Z ~ (1)
~ (1)
~ (1)
, ~ (0)
t o t t
t o t t
t
t t
X I
Y Z I
Z I
I
c
o o q
c q
= + +
= + +

,
t t
c q arestationaryprocess( (0) I )withzeromean,buttheycanbeseriallycorrelated.
Although,
t
X and
t
Y arebothnonstationary( (1) I ),thereexistsalinearcombinationofthem,whichis
stationary:

1 1
~ (0)
t t
X Y I o
Inotherwords,theregressionofYandXyieldsstationaryresiduals{ }
t
c .
Ingeneral,givenasetofnonstationary(oftype (1) I )timeseriesvariables
1, 2, ,
{ , ,..., }
t t k t
X X X ,there
existsalinearcombinationconsistingofallvariableswithavector | ,suchthat:

1 1, 2 2, ,
... ~ (0)
t t k k t
X X X I | | | + + +
Where 0, 1,2,...,
j
j k | = = .Ifthisisthecase,thenthe ' X s arecointegratedtotheorderof C.I(1,1)

Cointegration101 3 SpiderFinancialCorp,2013

## Testing for Cointegration

Inprinciple,testingforCointegrationissimilartotestingthelinearregressionresiduals(
t
c )for
stationarity.

1, 2 2, ,
...
t t k k t t
X X X o | | c = + + + +
So,toestablishacointegrationrelationship,youwouldrunfirstanOLSregressionmodelforyour
variablesandtesttheresidualsforstationarity.
Soundssimple?Itis.Butwhichvariableshouldweselectasthedependentvariable?Doesitmatter?It
turnsoutthatitdoesmatter.
Why?Theresidualsvarybasedonwhichtimeseriesisdesignatedasthedependentvariable,andthe
testsmaygivedifferentresults.
Oneimportanttestforcointegrationthatisinvarianttotheorderingofvariablesisthefullinformation
maximumlikelihoodtestofJohansen(akaJohansentest).
Johansen Test
TheJohansentestapproachesthetestingforcointegrationbyexaminingthenumberofindependent
linearcombinations( k )foran mtimeseriesvariablessetthatyieldsastationaryprocess.
Why?
Earlyinthispaper,westatedthatcointegrationassumesthepresenceofcommonnonstationary(i.e.
(1) I )processesunderlyingtheinputtimeseriesvariables.

1, 1 1 1, 2 2, , 1,
2, 2 1 1, 2 2, , 2,
, 2 1 1, 2 2, , ,
...
...
...
...
t t t p p t t
t t t p p t t
m t t t p p t m t
X Z Z Z
X Z Z Z
X Z Z Z
o c
o | | | c
o c
= + + + + +
= + + + + +
= + + + + +

Thenumberofindependentlinearcombinations( k )isrelatedtotheassumednumberofcommonnon
stationaryunderlyingprocesses( p )asfollows:
p m k =
So,letsconsiderthreeplausibleoutcomes:
1. 0, k p m = = Inthiscase,timeseriesvariablesarenotcointegrated.
2. 0 ,1 k m p m < < < < .Inthiscase,thetimeseriesvariablesarecointegrated.
3. , 0 k m p = = .Alltimeseriesvariablesarestationary( (0) I tostartwith.Cointegrationisnot
relevanthere.

Cointegration101 4 SpiderFinancialCorp,2013

Byexaminingthenumberofindependentcombinations,weareindirectlyexaminingthecointegration
existencehypothesis.
TheJohansentesthastwoforms:thetracetestandthemaximumeigenvaluetest.Bothforms/tests
Trace Test
Thetracetestexaminesthenumberoflinearcombinations(i.e. K )tobeequaltoagivenvalue(
o
K ),
andthealternativehypothesisfor K tobegreaterthan
o
K

: K
:
o o
A o
H K
H K K
=
>

TotestfortheexistenceofCointegrationusingthetracetest,weset 0
o
K = (nocointegration),and
examinewhetherthenullhypothesiscanberejected.Ifthisthecase,thenweconclude

thereisatleast
onecointegrationrelationship.
Inthiscase,weneedtorejectthenullhypothesistoestablishthepresenceofCointegrationbetween
thevariables.
Maximum Eigenvalue Test
difference,however,isanalternatehypothesis:
:K k
: k 1
o o
A o
H
H K
=
= +

So,startingwith 0
o
K = andrejectingthenullhypothesisimpliesthatthereisonlyonepossible
combinationofthenonstationaryvariablestoyieldastationaryprocess.Whatifwehavemorethan
one?Thetestmaybelesspowerfulthanthetracetestforthesame
o
K values.
Aspecialcaseforusingthemaximumeigenvaluetestiswhen 1
o
K m = ,whererejectingthenull
hypothesisimpliestheexistenceofmpossiblelinearcombinations.Thisisimpossible,unlessallinput
timeseriesvariablesarestationary( (0) I )tostartwith.

Cointegration101 5 SpiderFinancialCorp,2013

## Johansen Test with NumXL

InNumXL,theJohansentestcombinesthesetwotestformstoexaminethecointegrationassumption:
TraceTestfor 0
o
K =
MaximumEigenvalueTestfor 1
o
K m =
Toestablishtheexistenceofcointegrationinasetoftimeseriesvariables,wewishtorejectthetrace
testnullhypothesis( 0
o
K = )andnotrejectthenullhypothesisofthemaximumeigenvaluetest(
1
o
K m = ).
Now,letsgooverthestepsforconductingacointegrationtestinNumXL.
Step 1:
eachrowcorrespondstoanobservation.

Step 2:

Cointegration101 6 SpiderFinancialCorp,2013

Step 3:
Usingthecointegrationwizard,selectyourinputvariables.Theselectionmayincludecolumnlabels.

inputdataintheworksheet.Inourtutorial,wewanttoincludeallofthem,sowecanleaveitblank.
Afterweselecttheinputdata,theOptionsandMissingValuestabsareenabled.
Step 4: (Optional)
Initially,allJohansentestsareselectedandamaximumlagorderiscalculatedfromtheinputdata,but
youcanoverrideanyofthoseoptionsasyouseefit.

Cointegration101 7 SpiderFinancialCorp,2013

Letsleaveitunchanged.
Step 5: (Optional)

Bydefault,thecointegrationwizardwilltriggeranerrorifanyofthevariableshasamissingvalue.Thisis
acceptableforthistutorial.
ClicktheOKbutton.

Cointegration101 8 SpiderFinancialCorp,2013

Whenexaminingtheoutputtables,keepthisinmind: