Copulas 2
description
Transcript of Copulas 2
-
Correlations...asortacontinuationof2stocksmotivatedbyemailfromPeterU.
Wewanttoconsiderthepossibilityofgeneratingrandomreturnswithprescribedparameters...suchascorrelation.
WhenonetalksaboutthecorrelationbetweenstockAandstockB,oneusuallymeansthePearsoncorrelationwhichwouldgive,forexample:
Forexample,ifwelookatthelastfiveyearsofdailyGEreturnsandwishtocomparetotheS&P500returnswemightgetsomethinglikethesedistributions:
Figure1A Figure1B
Here,weseewhatfractionofthereturnslieintinyintervals.Forexample(seetheredbars?),itlookslikeabout3.4%lieinasmallintervalat0.8%(forGE)andabout3%lieinasmallintervalat0.5%(for^GSPC).
>TaDum!...andthecorrelationIS...huh?Forthesetwosets,GEandS&P,it'sabout78%andifweploteachofthosereturnsasapoint(x,y)=(S&Preturn,GEreturn)we'dgetsomethinglikeFigure1.
Theinterestingthingis,ifwewantedtoknowifthereweresomeunderlyingrelationshipbetweenthetwovariables(herethey'retwosetsofreturns),thenthePearsoncorrelationonlytriestoidentifyalinearrelationship.Thatis,ify=Ax+B,thePearsoncorrelationbetweenxandywouldbeequalto1...or100%. Figure2
-
>That'sPearsoncorrelation,butwhataboutSpearmancorrelationUh...yes,Spearman.Actually,Ididn'twanttotalkaboutPearsonorSpearman,Iwantedtotalkabout...
>Cupolas?Uh,notquite.Iwanttotalkaboutcopulas.
Notethatifreturnsarerelatednonlinearly(forexample),then...
>Nonlinearly?Yes.SupposethereturnsofstockAarer1,r2...r50andthereturnsofstockBare100r13,100r23...100r503.Ifthestocksstartoffat$10and$15respectively,thepricesmightlooksomethinglikeFigure3.
Whenonegoesupordowntheotherisboundtogoupordowninsynchronism.However,thePearsoncorrelationisonly75%despitethefactthatthetwosetsofreturnsareintimatelyrelated.
>Intimatelyandnonlinearly!Indeed.Note,however,thattheSpearmancorrelationis1(or100%).
Figure3
Infact,Spearmanmeasuresnotthelineardependencebutthemonotonedependencebetween...
>Huh?Spearmanassignstoeachstockreturnitsrank,so:
ForstockA,ifr1isthe7thlargestreturninthesetr1,r2...r50,thenwewritedown7.Ifr2isthe27thlargestreturninthesetr1,r2...r50,thenwewritedown27.etc.etc.Ifr50isthe3rdlargestreturninthesetr1,r2...r50,thenwewritedown3.WethendiscardthesequenceofreturnsandretainthesequenceofranksforstockA:[7,27,...3]Werepeat,toobtainasequenceofranksforstockB.ThenwetakethePearsoncorrelationofthetwosetsofrankstogettheSpearmancorrelation
>Andthatdoes...what?It'sguaranteedtogive100%SpearmancorrelationifthestockAandstockBgoupanddowntogether.Infact,thetwosequencesofranksareidentical(forourfictitiousstocksAandBwithreturnsrand100r3),sothePearsoncorrelationofranksisequalto1(or100%).Infact,ifwecanchangethesecondsettoanyincreasingfunctionofthefirstset,therankshencetheSpearmancorrelationisunchanged.Forexample,ifthesecondsetisr3orerorlog(1+r)or...whatever,thePearsoncorrelationremainsunchanged.>Idon'tseeanycopulasyet...Wewanttoseethe"correlation"betweenstocks,so
-
here'swhatwecando:
RememberFigure1?Itshowstwoseparatedistributions,andwhatfractionofreturnslieinthoseweeintervals.
We'dlikesomehowtoputthembothonthesamedistributionchart.
Wecould,forexample,combineFigures1and2togetFigure3,wheretheseparatedistributionsareshown...aswellastheplotof(S&Preturn,GEreturn).
>That'saCupola?Patience,we'renotatcupolasyet.
>Aha!YousaidCupola!Whatdoescopulamean,bytheway?Ihavenoidea
Figure3
Copulas
Okay,noticeoneneatthing.
Whenwediscardedthesequenceofreturnsandretainedthesequenceofranks,insteadofgettingadistributionlikeFigure1,weget...
>Adistributionofranks,right?Right.Butiftherearesay,100returnsdistributedinsomeweirdway,wegetasetofranks,eachbeingoneofthenumbersfrom1to100,andthey'redistributeduniformly.
>Huh?Don'tyousee?Therearejustasmany"ranks"intherange15asthereareintherange610asthereareintherange1115asthere...
>Okay!Okay!Igetit!Soifwedivideuptherange1to100into20intervals,eachoflength5,there'dbeequalnumbersof"ranks"ineachsubinterval.
>There'dbe5ineach.Yes,asillustratedinFigure4
Figure4
>Arewethereyet?Notquite,butweshouldgoslowlybecause...
>I'dbehappierifyou'djustdefineacopula!
Acopulaisaprobabilitydistributiononaunitcube[0,1]nforwhicheverymarginaldistributionisuniformontheinterval[0,1]
Happynow?
-
>No.Maybeyoushouldgoslow.
Okay.Noticethat,inFigure4,thebottomchartisauniformdistribution...derivedfromastandard,gardenvarietydistributioninthetopchart.Thatuniformdistributionthingisthekey.Rememberhowwegenerateastandard,gardenvarietydistributionfromauniformone?
>Areyoukidding?Weinventsomeincreasingfunction...likethebluecurveinFigure5.Itrunsfrom0attheleftto1attheright.Nowpick,atrandomnumber,anynumber,between0and1.Seethereddotatabout0.55?Nowruntotheright(toourbluecurve)thendown.Seethemagentadotlabelledr?Repeatajilliontimes,eachtimechoosingarandomnumberfrom0to1(ontheverticalaxis,likeour0.55above),andgettinginreturnanumberliker.Ifthedistributionofrandomnumbersselected(ontheverticalaxis)isuniform,thenthenumbersrwillbedistributedasshowningreen. Figure5
>Butthatgreencurveisastandard,gardenvarietydistribution...isn'tit?Yes,justlikeFigure1Aand1B,exceptit'ssmoothbecauseweinventedasmoothbluecurve.Thepointtonoticeisthatwe:
Startwithsomecurveincreasingfrom0to1(that'sthebluecurve).Selectfromauniformdistribution(thenumbersselectedatrandomontheverticalaxis,like5.5,above).Thengenerateour(final)distributionfunction(that'sthegreencurve).
>Ithoughtweweretalkingabouttwostocks.Well,twoassets,likemaybestocksandbonds.SoourprobemistogenerateadistributionforeachassetsothesetwodistributionshaveprescribedMean,VolatilityandCorrelation.
Thenwe'dliketogeneratesomethinglikeFigure6A,wherexandyarerandomvariablesand,foreachpair(x,y),wehaveaprobabilitythatthatpairwilloccur.Theprobabilityisgivenbytheheightofthesurface.
>Itgivestheprobabilitythatthetwovariablesareexactlyxandy?Well,no.It'stheprobabilityofbeinginsomesmallneighbourhoodof(x,y)...likeFigure1,above.
Forexample,ifx=1andy=2,thentheheightmightbez=0.05sotheprobablilityis0.05(or5%)thatxliesinsomesmallintervalaboutx=1(saybetween0.95and1.05)andyliesinsomesmallintervalabouty=2(saybetween1.95and2.05).
Figure6A
-
>Andthexandyvariableshavewhatkindofdistribution?InFigure6A,they'reeachnormallydistributed,but...
>Andthat'stypical?Typical?Theycanhaveanydistributionsyoulike.That'snotthepoint.Thepointisthatwe'dliketohavethemcorrelatedinsomeprescribedmannerand...
>Butyoualwayspicknormal!Okay!InFigure6B,oneisnormalandtheotherhasabetadistribution.
>Betawho?ThebetadistributionslooklikeFigure6C,wherepandqareparametersthatyouselect,AandBarechosensothatAxBandKissuchthattheareaunderthecurve(showningreen)is"1"(meaningthere'sa100%probabilitythatxliessomewherein[A,B]).
>AndinFigure6B,whichisnormalandwhichisbeta?Iforget
Figure6B
Figure6C
.
ConstructingCopulas
We'dliketoconstructajointdistribution(likeFigure6)withprescribedproperties.Todothis,wecanusethefollowing:
1. WeinventafunctionC(x,y)which,foreachpairxandylyingin[0,1],generatesanumberin[0,1].2. C(x,y)=0ifeitheroneofxoryis0.(Thatis:C(0,y)=C(x,0)=0forxandyin[0,1].)3. C(x,1)=xandC(1,y)=y.(Thatis,fory=1,C(x,1)=xincreasesfrom0to1asxincreasesfrom0to1.)4. C(x,y)isincreasinginbothxandy.(LikethebluecurveinFigure5.)
>Don'ttellme...CstandsforCopula,right?
Yes.ThevariousrequirementssaythatCmustbeincreasingandwhatshe'slikealongtheboundariesoftheunitsquare0x1,0y1.
>AndthatdefinesC?Hardly.Thereareajillionfunctionsoftwovariablesthatsatisfythoserequirements...andthey'reallpossibleCopulas.
Theneatthingisthat,havingpickedaCupola,wecangenerateajointdistributionfunctionforxandy(liketheoneshowninFigure6).
Figure7
SupposethedistributionfunctionsforxandyareF1(x)andF2(y).ThenC(F1(x),F2(y))isajointcumulativedistributionfunctionforxandy.
-
>Cumulative?Yousaidit'dgivesomethinglikeFigure6.Ilied.Figure6isthedensitydistribution.Cwillgivethe2dimensionalversionofthebluecurveinFigure5...likeFigure8.
>IassumeyoujustinventedFigure8,right?Notatall.Themagicformulais:
You'llnotice(nodoubt)thatallthefeaturesaboveareincorporatedinthisCopula.Forexample,C(x,1)=(1/d)log(edx)=x.
>What'sthat"d"?YoupickittosuityourCopularequirements
Figure8
WecanalsowritethatformulaforCinamoresanitaryform:
...whichmakesiteasytogeneralizetoumpteenvariables:x,y,z,u,v,w,etc.etc.
>Iassumeithasaname?Yes,it'sFrank'sCopula,namedafterM.J.Frank(whointroduceditin1979).
>Arethereothers?Well,there'sClaytonCopulasandGumbelwithvarioustypesthatgobythenameofGaussianorArchimedian(Frank'sisArchimedean)and...
>Yeah,thanks.Canwestopnow?No...
forPartII