Copulas and tail dependence, part 2

September 18, 2012
By

(This article was first published on Freakonometrics - Tag - R-english, and kindly contributed to R-bloggers)

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=456 and https://i1.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-3.2.php.png?w=456 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=456

But if we assume that those variables are (strictly) comonotonic (i.e. equal here since they have the same distribution), then

https://i2.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-4.2.php.png?w=456

So assume that there is a https://i0.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png?w=456
such that
Then https://i0.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png?w=456=2 can be interpreted as independence while https://i0.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toclatex2png-6.2.php.png?w=456=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=456

In order to derive a tail dependence index, assume that there exists a limit to

https://i1.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.2.php.png?w=456

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=456

for the lower tail (on the left) and

https://i2.wp.com/perso.univ-rennes1.fr/arthur.charpentier/latex/toc2latex2png.4.php.png?w=456

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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , , , , ,

Comments are closed.

Sponsors

Mango solutions



plotly webpage

dominolab webpage



Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training

datasociety

http://www.eoda.de







ODSC

ODSC

CRC R books series





Six Sigma Online Training









Contact us if you wish to help support R-bloggers, and place your banner here.

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)