[spcopula-commits] r119 - in pkg: demo man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 18 10:22:32 CET 2013


Author: ben_graeler
Date: 2013-12-18 10:22:32 +0100 (Wed, 18 Dec 2013)
New Revision: 119

Added:
   pkg/demo/tailDepFunctions.R
Modified:
   pkg/demo/00Index
   pkg/man/tailDepFun.Rd
Log:
- added demo on tail dependece functions

Modified: pkg/demo/00Index
===================================================================
--- pkg/demo/00Index	2013-12-05 21:39:45 UTC (rev 118)
+++ pkg/demo/00Index	2013-12-18 09:22:32 UTC (rev 119)
@@ -2,3 +2,4 @@
 spCopula		A demo illustrating the estiamtion of a single spatial tree vine copula for a SpatialPointsDataFrame.
 pureSpVineCopula  	A demo illustrating the estiamtion of a pure spatial vine copula for a SpatialPointsDataFrame.
 stVineCopFit    A demo corresponding to the vignette estimating a spatio-temporal vine copula.
+tailDepFunctions    A demo illustrating the empirical tail dependece function with parametric parametric tail dependence functions for different families of copulas.

Added: pkg/demo/tailDepFunctions.R
===================================================================
--- pkg/demo/tailDepFunctions.R	                        (rev 0)
+++ pkg/demo/tailDepFunctions.R	2013-12-18 09:22:32 UTC (rev 119)
@@ -0,0 +1,26 @@
+library(spcopula)
+data(simulatedTriples)
+
+rtPair <- 1-as.matrix(rankTransform(triples[,c(1,3)]))
+
+plot(rtPair,asp=1)
+
+tdfEmp <- empTailDepFun(rtPair)
+plot(tdfEmp,ylim=c(0,1), ylab="tail index", xlab="u")
+abline(v=0.5, col="grey")
+
+gaussCop <- fitCopula(normalCopula(0), rtPair)@copula
+tdfGauss <- tailDepFun(gaussCop)
+curve(tdfGauss, add=T,col="green",n=500)
+
+gumbelCop <- fitCopula(gumbelCopula(2),rtPair)@copula
+tdfGumbel <- tailDepFun(gumbelCop)
+curve(tdfGumbel,add=T, col="blue",n=500)
+
+BB6Cop <- fitCopula(BB6Copula(), rtPair)@copula
+tdfBB6 <- tailDepFun(BB6Cop)
+curve(tdfBB6, add=T,col="red",n=500)
+
+legend("bottomright",
+       c("empirical", "Gaussian", "Gumbel", "BB6"),
+       col=c("black", "green", "blue", "red"), lty=1)
\ No newline at end of file

Modified: pkg/man/tailDepFun.Rd
===================================================================
--- pkg/man/tailDepFun.Rd	2013-12-05 21:39:45 UTC (rev 118)
+++ pkg/man/tailDepFun.Rd	2013-12-18 09:22:32 UTC (rev 119)
@@ -36,7 +36,7 @@
 A function taking arguments from the unit interval (0,1) and returning the corresponding tail index.
 }
 \references{
-Inspired by: \url{http://www.r-bloggers.com/copulas-and-tail-dependence-part-1/}
+Inspired by: \url{http://freakonometrics.blog.free.fr/index.php?post/2012/09/11/Copulas-and-statistical-inference}
 }
 \author{
 Benedikt Graeler
@@ -67,4 +67,4 @@
 
 legend("bottomleft",c("empircal","Gauss","surv. Gumbel","surv. BB6"),
        col=c("black","blue","darkgreen","red"),lty=1)
-}
\ No newline at end of file
+} 
\ No newline at end of file



More information about the spcopula-commits mailing list