Copulas and tail dependence, part 2

[This article was first published on Freakonometrics - Tag - R-english, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

An alternative to describe tail dependence can be found in the Ledford & Tawn (1996) for instance. The intuition behind can be found in Fischer & Klein (2007)). Assume that https://i0.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-2.2.php.png?w=578 and https://i1.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-3.2.php.png?w=578 have the same distribution. Now, if we assume that those variables are (strictly) independent,

https://i0.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-1.2.php.png?w=578
But if we assume that those variables are (strictly) comonotonic (i.e. equal here since they have the same distribution), then
https://i1.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-4.2.php.png?w=578
So assume that there is a https://i1.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png?w=578 such that
Then https://i1.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png?w=578=2 can be interpreted as independence while https://i1.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png?w=578=1 means strong (perfect) positive dependence. Thus, consider the following transformation to get a parameter in [0,1], with a strength of dependence increasing with the index, e.g.
https://i1.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-8.2.php.png?w=578
In order to derive a tail dependence index, assume that there exists a limit to
https://i2.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.2.php.png?w=578
which will be interpreted as a (weak) tail dependence index. Thus define concentration functions

https://i2.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.3.php.png?w=578
for the lower tail (on the left) and
https://i0.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.4.php.png?w=578

for the upper tail (on the right). The R code to compute those functions is quite simple,
> library(evd); 
> data(lossalae)
> X=lossalae
> U=rank(X[,1])/(nrow(X)+1)
> V=rank(X[,2])/(nrow(X)+1
> fL2emp=function(z) 2*log(mean(U<=z))/
+ log(mean((U<=z)&(V<=z)))-1
> fR2emp=function(z) 2*log(mean(U>=1-z))/
+ log(mean((U>=1-z)&(V>=1-z)))-1
> u=seq(.001,.5,by=.001)
> L=Vectorize(fL2emp)(u)
> R=Vectorize(fR2emp)(rev(u))
> plot(c(u,u+.5-u[1]),c(L,R),type="l",ylim=0:1,
+ xlab="LOWER TAIL      UPPER TAIL")
> abline(v=.5,col="grey")
and again, it is possible to plot those empirical functions against some parametric ones, e.g. the one obtained from a Gaussian copula (with the same Kendall’s tau)
> tau=cor(lossalae,method="kendall")[1,2]
> library(copula)
> paramgauss=sin(tau*pi/2)
> copgauss=normalCopula(paramgauss)
> Lgaussian=function(z) 2*log(z)/log(pCopula(c(z,z),
+ copgauss))-1
> Rgaussian=function(z) 2*log(1-z)/log(1-2*z+
+ pCopula(c(z,z),copgauss))-1
> u=seq(.001,.5,by=.001)
> Lgs=Vectorize(Lgaussian)(u)
> Rgs=Vectorize(Rgaussian)(1-rev(u))
> lines(c(u,u+.5-u[1]),c(Lgs,Rgs),col="red")

or Gumbel copula,
> paramgumbel=1/(1-tau)
> copgumbel=gumbelCopula(paramgumbel, dim = 2)
> Lgumbel=function(z) 2*log(z)/log(pCopula(c(z,z),
+ copgumbel))-1
> Rgumbel=function(z) 2*log(1-z)/log(1-2*z+
+ pCopula(c(z,z),copgumbel))-1
> Lgl=Vectorize(Lgumbel)(u)
> Rgl=Vectorize(Rgumbel)(1-rev(u))
> lines(c(u,u+.5-u[1]),c(Lgl,Rgl),col="blue")

Again, one should look more carefully at confidence bands, but is looks like Gumbel copula provides a good fit here.

To leave a comment for the author, please follow the link and comment on their blog: Freakonometrics - Tag - R-english.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)