{"word_count": 462, "character_count": 4281}
As mentioned in the course last week Venter (2003) suggested nice functions to illustrate tail dependence (see also some slides used in Berlin a few years ago).  Slides astin  from Arthur Charpentier Joe (1990)'s lambdaJoe (1990) suggested a (strong) tail dependence index. For lower tails, for instance, consideri.e Upper and lower strong tail (empirical) dependence functionsThe idea is to plot the function above, in order to visualize limiting behavior. Definefor the lower tail, andfor the upper tail, where  is the survival copula associated with , in the sense thatwhileNow, one can easily derive empirical conterparts of those function, i.e.andThus, for upper tail, on the right, we have the following graphand for the lower tail, on the left, we haveFor the code, consider some real data, like the loss-ALAE dataset.&#62; library(evd)&#62; X=lossalaeThe idea is to plot, on the left, the lower tail concentration function, and on the right, the upper tail function.&#62; U=rank(X[,1])/(nrow(X)+1)&#62; V=rank(X[,2])/(nrow(X)+1)&#62; Lemp=function(z) sum((U&#60;=z)&#38;(V&#60;=z))/sum(U&#60;=z)&#62; Remp=function(z) sum((U&#62;=1-z)&#38;(V&#62;=1-z))/sum(U&#62;=1-z)&#62; u=seq(.001,.5,by=.001)&#62; L=Vectorize(Lemp)(u)&#62; R=Vectorize(Remp)(rev(u))&#62; plot(c(u,u+.5-u[1]),c(L,R),type="l",ylim=0:1,+ xlab="LOWER TAIL          UPPER TAIL")&#62; abline(v=.5,col="grey")Now, we can compare this graph, with what should be obtained for some parametric copulas that have the same Kendall's tau (e.g.). For instance, if we consider a Gaussian copula,&#62; tau=cor(lossalae,method="kendall")[1,2]&#62; library(copula)&#62; paramgauss=sin(tau*pi/2)&#62; copgauss=normalCopula(paramgauss)&#62; Lgaussian=function(z) pCopula(c(z,z),copgauss)/z&#62; Rgaussian=function(z) (1-2*z+pCopula(c(z,z),copgauss))/(1-z)&#62; u=seq(.001,.5,by=.001)&#62; Lgs=Vectorize(Lgaussian)(u)&#62; Rgs=Vectorize(Rgaussian)(1-rev(u))&#62; lines(c(u,u+.5-u[1]),c(Lgs,Rgs),col="red")or Gumbel's copula,&#62; paramgumbel=1/(1-tau)&#62; copgumbel=gumbelCopula(paramgumbel, dim = 2)&#62; Lgumbel=function(z) pCopula(c(z,z),copgumbel)/z&#62; Rgumbel=function(z) (1-2*z+pCopula(c(z,z),copgumbel))/(1-z)&#62; u=seq(.001,.5,by=.001)&#62; Lgl=Vectorize(Lgumbel)(u)&#62; Rgl=Vectorize(Rgumbel)(1-rev(u))&#62; lines(c(u,u+.5-u[1]),c(Lgl,Rgl),col="blue")That's nice (isn't it?), but since we do not have any confidence interval, it is still hard to conclude (even if it looks like Gumbel copula has a much better fit than the Gaussian one). A strategy can be to generate samples from those copulas, and to visualize what we had. With a Gaussian copula, the graph looks like&#62; u=seq(.0025,.5,by=.0025); nu=length(u)&#62; nsimul=500&#62; MGS=matrix(NA,nsimul,2*nu)&#62; for(s in 1:nsimul){+ Xs=rCopula(nrow(X),copgauss)+ Us=rank(Xs[,1])/(nrow(Xs)+1)+ Vs=rank(Xs[,2])/(nrow(Xs)+1)+ Lemp=function(z) sum((Us&#60;=z)&#38;(Vs&#60;=z))/sum(Us&#60;=z)+ Remp=function(z) sum((Us&#62;=1-z)&#38;(Vs&#62;=1-z))/sum(Us&#62;=1-z)+ MGS[s,1:nu]=Vectorize(Lemp)(u)+ MGS[s,(nu+1):(2*nu)]=Vectorize(Remp)(rev(u))+ lines(c(u,u+.5-u[1]),MGS[s,],col="red")+ }(including - pointwise - 90% confidence bands)&#62; Q95=function(x) quantile(x,.95)&#62; V95=apply(MGS,2,Q95)&#62; lines(c(u,u+.5-u[1]),V95,col="red",lwd=2)&#62; Q05=function(x) quantile(x,.05)&#62; V05=apply(MGS,2,Q05)&#62; lines(c(u,u+.5-u[1]),V05,col="red",lwd=2)while it iswith Gumbel copula. Isn't it a nice (graphical) tool ?But as mentioned in the course, the statistical convergence can be slow. Extremely slow. So assessing if the underlying copula has tail dependence, or not, it now that simple. Especially if the copula exhibits tail independence. Like the Gaussian copula. Consider a sample of size 1,000. This is what we obtain if we generate random scenarios,or we look at the left tail (with a log-scale)Now, consider a 10,000 sample,or with a log-scaleWe can even consider a 100,000 sample,or with a log-scaleOn those graphs, it is rather difficult to conclude if the limit is 0, or some strictly positive value (again, it is a classical statistical problem when the value of interest is at the border of the support of the parameter). So, a natural idea is to consider a weaker tail dependence index. Unless you have something like 100,000 observations...