From noreply at r-forge.r-project.org Fri Aug 7 09:38:07 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 7 Aug 2015 09:38:07 +0200 (CEST) Subject: [spcopula-commits] r145 - in pkg: . R demo tests/Examples Message-ID: <20150807073807.1BDC818619B@r-forge.r-project.org> Author: ben_graeler Date: 2015-08-07 09:38:06 +0200 (Fri, 07 Aug 2015) New Revision: 145 Modified: pkg/DESCRIPTION pkg/R/returnPeriods.R pkg/demo/pureSpVineCopula.R pkg/tests/Examples/spcopula-Ex.Rout.save Log: - return period updates Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2015-05-26 14:41:35 UTC (rev 144) +++ pkg/DESCRIPTION 2015-08-07 07:38:06 UTC (rev 145) @@ -2,7 +2,7 @@ Type: Package Title: Copula Driven Spatio-Temporal Analysis Version: 0.2-1 -Date: 2015-05-26 +Date: 2015-07-02 Authors at R: c(person("Benedikt", "Graeler", role = c("aut", "cre"), email = "ben.graeler at uni-muenster.de"), person("Marius", "Appel",role = "ctb")) Modified: pkg/R/returnPeriods.R =================================================================== --- pkg/R/returnPeriods.R 2015-05-26 14:41:35 UTC (rev 144) +++ pkg/R/returnPeriods.R 2015-08-07 07:38:06 UTC (rev 145) @@ -38,17 +38,21 @@ } ## return periods -kendallRP <- function(kendallFun=NULL, cl=c(.99,.999), mu=1, copula=NULL) { - if(is.null(kendallFun) & is.null(copula)) stop("Either the kendall distribution function or the copula must be provided. Note that the calculation of the kendall distribution function from the copula is pretty time consuming. Saving them separately might be advantougous.") - if(is.null(kendallFun)) kendallFun <- genEmpKenFun(copula) +kendallRP <- function(kendallFun, cl=c(.99,.999), mu=1, copula) { + if(is.missing(kendallFun) & is.missing(copula)) + stop("Either the kendall distribution function or the copula must be provided. Note that the calculation of the kendall distribution function from the copula is pretty time consuming. Saving them separately might be advantageous.") + if(is.missing(kendallFun)) kendallFun <- genEmpKenFun(copula) if(length(mu)>1 & length(cl) > 1) stop("Either the critial level (cl) or mu may be of length larger than 1!") return(mu/(1-kendallFun(cl))) } -criticalLevel <- function(kendallFun=NULL, KRP=c(100,1000), mu=1, copula=NULL) { - if(is.null(kendallFun) & is.null(copula)) stop("Either the kendall distribution function or the copula must be provided. Note that the calculation of the kendall distribution function from the copula is pretty time consuming. Saving them separately might be advantougous.") - if(is.null(kendallFun)) kendallFun <- genEmpKenFun(copula) - if(length(mu)>1 & length(KRP) > 1) stop("Either the kendall return period or mu may be of length larger than 1!") +criticalLevel <- function(kendallFun, KRP=c(100,1000), mu=1, copula) { + if(is.missing(kendallFun) & is.missing(copula)) + stop("Either the kendall distribution function or the copula must be provided. Note that the calculation of the kendall distribution function from the copula is pretty time consuming. Saving them separately might be advantageous.") + if(is.missing(kendallFun)) + kendallFun <- genEmpKenFun(copula) + if(length(mu)>1 & length(KRP) > 1) + stop("Either the kendall return period or mu may be of length larger than 1!") invKenFun <- genInvKenFun(kendallFun) return(invKenFun(1-mu/KRP)) } @@ -176,10 +180,11 @@ # empirical default getKendallDistr <- function(copula, sample=NULL) { - standardGeneric("getKendallDistr") - if(is.null(sample)) sample <- rcopula(copula,1e6) - empCop <- genEmpCop(sample) - ken <- empCop(sample) # takes really long, any suggestions? Comparring a 1e6x3/1e6x2 matrix by 1e6 pairs/triplets values +# standardGeneric("getKendallDistr") + if(is.null(sample)) + sample <- rCopula(1e6, copula) + empCop <- empiricalCopula(sample, copula) + ken <- pCopula(sample, empCop) # takes really long, any suggestions? Comparring a 1e6x3/1e6x2 matrix by 1e6 pairs/triplets values empKenFun <- function(tlevel) { res <- NULL Modified: pkg/demo/pureSpVineCopula.R =================================================================== --- pkg/demo/pureSpVineCopula.R 2015-05-26 14:41:35 UTC (rev 144) +++ pkg/demo/pureSpVineCopula.R 2015-08-07 07:38:06 UTC (rev 145) @@ -29,15 +29,15 @@ meuse$rtZinc <- rank(meuse$zinc)/(length(meuse)+1) hist(meuse$rtZinc) ## lag classes ## -bins <- calcBins(meuse,var="rtZinc", nbins=10, cutoff=800) +bins <- calcBins(meuse, var="rtZinc", nbins=10, cutoff=800) ## calculate parameters for Kendall's tau function ## calcKTau <- fitCorFun(bins, degree=2) curve(calcKTau,0, 1000, col="purple",add=T) -families <- list(normalCopula(0), tCopula(0,df=2.15), claytonCopula(0), - gumbelCopula(1), frankCopula(1), joeBiCopula(1.5), +families <- list(normalCopula(0.3), tCopula(0.3,df=2.15), claytonCopula(0.3), + gumbelCopula(2), frankCopula(1), joeBiCopula(1.5), surClaytonCopula(1), surGumbelCopula(1), surJoeBiCopula(1.5)) ## find best fitting copula per lag class @@ -112,7 +112,7 @@ function(x) which(x==9)) colnames(loglikTau4$loglik)[bestFitTau4] -## set up the third bivariate spatial Copula +## set up the fourth bivariate spatial Copula ############################################# spCop4 <- spCopula(c(families[bestFitTau4[1:3]], normalCopula(0),indepCopula()), distances=bins4$meanDists[1:5], Modified: pkg/tests/Examples/spcopula-Ex.Rout.save =================================================================== --- pkg/tests/Examples/spcopula-Ex.Rout.save 2015-05-26 14:41:35 UTC (rev 144) +++ pkg/tests/Examples/spcopula-Ex.Rout.save 2015-08-07 07:38:06 UTC (rev 145) @@ -1,6 +1,6 @@ -R version 3.1.1 (2014-07-10) -- "Sock it to Me" -Copyright (C) 2014 The R Foundation for Statistical Computing +R version 3.2.0 (2015-04-16) -- "Full of Ingredients" +Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -21,9 +21,20 @@ > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > options(pager = "console") +> base::assign(".ExTimings", "spcopula-Ex.timings", pos = 'CheckExEnv') +> base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 'CheckExEnv')) +> base::assign(".format_ptime", ++ function(x) { ++ if(!is.na(x[4L])) x[1L] <- x[1L] + x[4L] ++ if(!is.na(x[5L])) x[2L] <- x[2L] + x[5L] ++ options(OutDec = '.') ++ format(x[1L:3L], digits = 7L) ++ }, ++ pos = 'CheckExEnv') +> +> ### * > library('spcopula') Loading required package: copula -Loading required package: VineCopula > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > cleanEx() @@ -32,6 +43,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: EU_RB > ### Title: Daily mean PM10 concentrations over Europe in June and July 2005 > ### Aliases: EU_RB @@ -57,7 +69,7 @@ .. .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. .. ..$ : chr [1:2] "coords.x1" "coords.x2" .. .. .. .. ..$ : chr [1:2] "min" "max" - .. .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots + .. .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. .. ..@ projargs: chr " +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs" ..@ time :An 'xts' object on 2005-06-01/2005-07-31 containing: Data: int [1:61, 1] 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 ... @@ -71,12 +83,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("EU_RB", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("EU_RB_2005") > ### * EU_RB_2005 > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: EU_RB_2005 > ### Title: Daily mean PM10 concentrations over Europe in 2005 as used in > ### the JSS manuscript @@ -111,7 +126,7 @@ .. .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. .. ..$ : chr [1:2] "coords.x1" "coords.x2" .. .. .. .. ..$ : chr [1:2] "min" "max" - .. .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots + .. .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. .. ..@ projargs: chr " +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs" ..@ time :An 'xts' object on 2005-01-01/2005-12-31 containing: Data: int [1:365, 1] 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 ... @@ -125,12 +140,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("EU_RB_2005", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("asCopula-class") > ### * asCopula-class > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: asCopula-class > ### Title: Class '"asCopula"' > ### Aliases: asCopula-class dduCopula,matrix,asCopula-method @@ -159,12 +177,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("asCopula-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("asCopula") > ### * asCopula > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: asCopula > ### Title: Constructor of an asymmetric copula with cubic and quadratic > ### sections (Nelsen 2006). @@ -177,12 +198,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("asCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("calcBins") > ### * calcBins > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: calcBins > ### Title: A function calculating the spatial/spatio-temporal bins > ### Aliases: calcBins calcBins-methods calcBins,Spatial-method @@ -201,6 +225,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("calcBins", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:sp' @@ -210,6 +236,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: composeSpCopula > ### Title: Composing a bivariate Spatial Copula > ### Aliases: composeSpCopula @@ -229,12 +256,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("composeSpCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("condCovariate") > ### * condCovariate > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: condCovariate > ### Title: Conditioning of a Covariate > ### Aliases: condCovariate @@ -263,6 +293,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("condCovariate", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:spacetime', 'package:sp' @@ -272,6 +304,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: condSpVine > ### Title: Conditions a spatial vine copula for conditional prediction > ### Aliases: condSpVine @@ -279,6 +312,7 @@ > > ### ** Examples > +> library("VineCopula") > data("spCopDemo") > > calcKTauPol <- fitCorFun(bins, degree=3) @@ -320,12 +354,18 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("condSpVine", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() + +detaching 'package:VineCopula' + > nameEx("condStCoVarVine") > ### * condStCoVarVine > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: condStCoVarVine > ### Title: conditional distribution function of spatio-temporal covariate > ### vine copula @@ -333,6 +373,7 @@ > > ### ** Examples > +> library("VineCopula") > spCopT0 <- spCopula(components=list(claytonCopula(8), claytonCopula(4), + claytonCopula(2), claytonCopula(1), + claytonCopula(0.5), indepCopula()), @@ -362,12 +403,18 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("condStCoVarVine", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() + +detaching 'package:VineCopula' + > nameEx("condStVine") > ### * condStVine > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: condStVine > ### Title: Conditions a spatio-temporal vine copula for conditional > ### prediction @@ -377,6 +424,7 @@ > ### ** Examples > > # a spatio-temporal C-vine copula (with independent copulas in the upper vine) +> library("VineCopula") > > spCopT0 <- spCopula(components=list(claytonCopula(8), claytonCopula(4), + claytonCopula(2), claytonCopula(1), @@ -402,12 +450,18 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("condStVine", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() + +detaching 'package:VineCopula' + > nameEx("cqsCopula-class") > ### * cqsCopula-class > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: cqsCopula-class > ### Title: Class '"cqsCopula"' > ### Aliases: cqsCopula-class dduCopula,matrix,cqsCopula-method @@ -436,12 +490,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("cqsCopula-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("cqsCopula") > ### * cqsCopula > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: cqsCopula > ### Title: Constructor of a symmetric copula with cubic quadratic sections. > ### Aliases: cqsCopula @@ -453,12 +510,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("cqsCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("criticalLevel") > ### * criticalLevel > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: criticalLevel > ### Title: Calculating the critical level for a given Kendall Return Period > ### Aliases: criticalLevel @@ -471,12 +531,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("criticalLevel", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("criticalPair") > ### * criticalPair > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: criticalPair > ### Title: Calculate Critical Pairs > ### Aliases: criticalPair @@ -490,12 +553,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("criticalPair", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("criticalTriple") > ### * criticalTriple > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: criticalTriple > ### Title: calculate critical triples > ### Aliases: criticalTriple @@ -512,12 +578,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("criticalTriple", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("dduCopula") > ### * dduCopula > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: dduCopula > ### Title: partial derivatives of copulas > ### Aliases: dduCopula ddvCopula @@ -555,12 +624,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("dduCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("dependencePlot") > ### * dependencePlot > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: dependencePlot > ### Title: Kernel smoothed scatter plot > ### Aliases: dependencePlot @@ -572,12 +644,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("dependencePlot", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("empiricalCopula-class") > ### * empiricalCopula-class > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: empiricalCopula-class > ### Title: Class '"empiricalCopula"' > ### Aliases: empiricalCopula-class @@ -602,12 +677,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("empiricalCopula-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("empiricalCopula") > ### * empiricalCopula > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: empiricalCopula > ### Title: Constructor of an empirical copula class > ### Aliases: empiricalCopula @@ -659,12 +737,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("empiricalCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("fitCorFun") > ### * fitCorFun > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: fitCorFun > ### Title: Automated fitting of a correlation function to the correlogram > ### Aliases: fitCorFun @@ -710,12 +791,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("fitCorFun", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("fitSpCopula") > ### * fitSpCopula > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: fitSpCopula > ### Title: Spatial Copula Fitting > ### Aliases: fitSpCopula @@ -882,6 +966,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("fitSpCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:sp' @@ -891,6 +977,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: genEmpCop > ### Title: Generate an empirical copula > ### Aliases: genEmpCop @@ -911,12 +998,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("genEmpCop", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("genEmpKenFun") > ### * genEmpKenFun > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: genEmpKenFun > ### Title: Generates an empirical Kendall distribution function > ### Aliases: genEmpKenFun @@ -930,12 +1020,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("genEmpKenFun", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("genInvKenFun") > ### * genInvKenFun > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: genInvKenFun > ### Title: Generate the inverse Kendall distribution function > ### Aliases: genInvKenFun @@ -953,12 +1046,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("genInvKenFun", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("getKendallDistr") > ### * getKendallDistr > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: getKendallDistr > ### Title: Retrieving the Kendall Distribution function for a given copula > ### Aliases: getKendallDistr getKendallDistr,claytonCopula-method @@ -976,12 +1072,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("getKendallDistr", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("getNeighbours") > ### * getNeighbours > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: getNeighbours > ### Title: Creating Local Neighbourhoods > ### Aliases: getNeighbours @@ -1000,6 +1099,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("getNeighbours", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:sp' @@ -1009,6 +1110,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: getStNeighbours > ### Title: Creating Local Spatio-Temporal Neighbourhoods > ### Aliases: getStNeighbours @@ -1035,6 +1137,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("getStNeighbours", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:spacetime', 'package:sp' @@ -1044,6 +1148,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: kendallDistribution > ### Title: The Kendall distribution > ### Aliases: kendallDistribution kendallDistribution,claytonCopula-method @@ -1062,12 +1167,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("kendallDistribution", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("kendallRP") > ### * kendallRP > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: kendallRP > ### Title: calculating the Kendall Return Period > ### Aliases: kendallRP @@ -1080,12 +1188,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("kendallRP", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("loglikByCopulasLags") > ### * loglikByCopulasLags > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: loglikByCopulasLags > ### Title: Log-likelihoods by copula family and spatial lag class > ### Aliases: loglikByCopulasLags @@ -1253,6 +1364,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("loglikByCopulasLags", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:sp' @@ -1262,6 +1375,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: loglikByCopulasStLags > ### Title: Log-likelihoods by copula family and spatio-temporal lag class > ### Aliases: loglikByCopulasStLags @@ -1429,6 +1543,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("loglikByCopulasStLags", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:sp' @@ -1438,6 +1554,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: neighbourhood-class > ### Title: Class 'neighbourhood' > ### Aliases: neighbourhood-class names,neighbourhood-method @@ -1457,6 +1574,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("neighbourhood-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:sp' @@ -1466,6 +1585,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: neighbourhood > ### Title: Constructor of the 'neighbourhood' class. > ### Aliases: neighbourhood @@ -1492,6 +1612,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("neighbourhood", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:sp' @@ -1501,6 +1623,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: qCopula_u > ### Title: The inverse of a bivariate copula given u or v > ### Aliases: qCopula_u qCopula_u,copula-method qCopula_v @@ -1521,12 +1644,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("qCopula_u", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("rankTransform") > ### * rankTransform > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: rankTransform > ### Title: rank order transformation of margins > ### Aliases: rankTransform @@ -1543,12 +1669,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("rankTransform", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("reduceNeighbours") > ### * reduceNeighbours > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: reduceNeighbours > ### Title: Selecting the strongest correlated neighbours > ### Aliases: reduceNeighbours @@ -1594,6 +1723,8 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("reduceNeighbours", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() detaching 'package:spacetime', 'package:sp' @@ -1603,6 +1734,7 @@ > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: simulatedTriples > ### Title: annual extreme rainfall triples > ### Aliases: triples @@ -1619,12 +1751,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("simulatedTriples", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("spCopDemo") > ### * spCopDemo > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: spCopDemo > ### Title: workspace produced in 'demo(spCopula)' > ### Aliases: lokliktau bestFitTau bins calcKTauLin calcKTauPol dataSet @@ -1639,12 +1774,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("spCopDemo", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("spCopPredict") > ### * spCopPredict > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: spCopPredict > ### Title: spatial prediction based on a spatial vine copula > ### Aliases: spCopPredict @@ -1653,6 +1791,7 @@ > ### ** Examples > > library("sp") +> library("VineCopula") > data("meuse.grid") > coordinates(meuse.grid) <- ~x+y > gridded(meuse.grid) <- TRUE @@ -1734,15 +1873,18 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("spCopPredict", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:sp' +detaching 'package:VineCopula', 'package:sp' > nameEx("spCopula-class") > ### * spCopula-class > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: spCopula-class > ### Title: Class '"spCopula"' > ### Aliases: spCopula-class dduCopula,matrix,spCopula-method @@ -1789,12 +1931,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") +> base::cat("spCopula-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("spCopula") > ### * spCopula > > flush(stderr()); flush(stdout()) > +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: spCopula > ### Title: Spatial Copula > ### Aliases: spCopula @@ -1828,12 +1973,15 @@ > > > +> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/spcopula -r 145 From noreply at r-forge.r-project.org Fri Aug 7 16:09:43 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 7 Aug 2015 16:09:43 +0200 (CEST) Subject: [spcopula-commits] r146 - in pkg: . R Message-ID: <20150807140943.64EED183C47@r-forge.r-project.org> Author: ben_graeler Date: 2015-08-07 16:09:43 +0200 (Fri, 07 Aug 2015) New Revision: 146 Modified: pkg/DESCRIPTION pkg/R/returnPeriods.R Log: - corrected wrong function names Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2015-08-07 07:38:06 UTC (rev 145) +++ pkg/DESCRIPTION 2015-08-07 14:09:43 UTC (rev 146) @@ -2,7 +2,7 @@ Type: Package Title: Copula Driven Spatio-Temporal Analysis Version: 0.2-1 -Date: 2015-07-02 +Date: 2015-08-07 Authors at R: c(person("Benedikt", "Graeler", role = c("aut", "cre"), email = "ben.graeler at uni-muenster.de"), person("Marius", "Appel",role = "ctb")) Modified: pkg/R/returnPeriods.R =================================================================== --- pkg/R/returnPeriods.R 2015-08-07 07:38:06 UTC (rev 145) +++ pkg/R/returnPeriods.R 2015-08-07 14:09:43 UTC (rev 146) @@ -1,18 +1,15 @@ genEmpKenFun <- function(copula, sample=NULL) { - if(is.null(sample)) sample <- rCopula(1e6,copula) - # as empirical copula: - # copula <- genEmpCop(copula, sample) + if(is.null(sample)) + sample <- rCopula(1e6,copula) if(missing(copula)) { - ken <- mapply(function(x,y) sum(x > sample[,1] & y > sample[,2])/length(x), sample[,1], sample[,2]) + # taken from package copula function "Kn" + stopifnot((n <- nrow(sample)) >= 1, (d <- ncol(sample)) >= 1) + ken <- vapply(seq_len(n), function(i) sum(colSums(t(sample) < sample[i, ]) == d)/(n + 1), NA_real_) } else { ken <- pCopula(sample, copula) } - empKenFun <- function(tlevel) { - sapply(tlevel,function(t) sum(ken<=t))/nrow(sample) - } - - return(empKenFun) + return(ecdf(ken)) } ## inverse kendall function @@ -39,17 +36,17 @@ ## return periods kendallRP <- function(kendallFun, cl=c(.99,.999), mu=1, copula) { - if(is.missing(kendallFun) & is.missing(copula)) + if(missing(kendallFun) & missing(copula)) stop("Either the kendall distribution function or the copula must be provided. Note that the calculation of the kendall distribution function from the copula is pretty time consuming. Saving them separately might be advantageous.") - if(is.missing(kendallFun)) kendallFun <- genEmpKenFun(copula) + if(missing(kendallFun)) kendallFun <- genEmpKenFun(copula) if(length(mu)>1 & length(cl) > 1) stop("Either the critial level (cl) or mu may be of length larger than 1!") return(mu/(1-kendallFun(cl))) } criticalLevel <- function(kendallFun, KRP=c(100,1000), mu=1, copula) { - if(is.missing(kendallFun) & is.missing(copula)) + if(missing(kendallFun) & missing(copula)) stop("Either the kendall distribution function or the copula must be provided. Note that the calculation of the kendall distribution function from the copula is pretty time consuming. Saving them separately might be advantageous.") - if(is.missing(kendallFun)) + if(missing(kendallFun)) kendallFun <- genEmpKenFun(copula) if(length(mu)>1 & length(KRP) > 1) stop("Either the kendall return period or mu may be of length larger than 1!") From noreply at r-forge.r-project.org Fri Aug 14 15:14:05 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 14 Aug 2015 15:14:05 +0200 (CEST) Subject: [spcopula-commits] r147 - in pkg: . R man Message-ID: <20150814131406.04252187904@r-forge.r-project.org> Author: ben_graeler Date: 2015-08-14 15:14:05 +0200 (Fri, 14 Aug 2015) New Revision: 147 Added: pkg/man/bivTailDepFun.Rd Removed: pkg/man/tailDepFun.Rd Modified: pkg/DESCRIPTION pkg/NAMESPACE pkg/R/cqsCopula.R pkg/R/tailDependenceFunctions.R pkg/man/criticalLevel.Rd pkg/man/kendallRP.Rd Log: introduced limit of the tail dependence functions for 2-dimensional copulas in view of paper by Joe et al. (2010) -> rename of tailDepFun to bivTailDepFun Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2015-08-07 14:09:43 UTC (rev 146) +++ pkg/DESCRIPTION 2015-08-14 13:14:05 UTC (rev 147) @@ -2,7 +2,7 @@ Type: Package Title: Copula Driven Spatio-Temporal Analysis Version: 0.2-1 -Date: 2015-08-07 +Date: 2015-08-14 Authors at R: c(person("Benedikt", "Graeler", role = c("aut", "cre"), email = "ben.graeler at uni-muenster.de"), person("Marius", "Appel",role = "ctb")) Modified: pkg/NAMESPACE =================================================================== --- pkg/NAMESPACE 2015-08-07 14:09:43 UTC (rev 146) +++ pkg/NAMESPACE 2015-08-14 13:14:05 UTC (rev 147) @@ -61,8 +61,8 @@ # fitting export(fitCorFun, loglikByCopulasLags, loglikByCopulasStLags, fitSpCopula, composeSpCopula) -export(tailDepFun, lowerTailDepFun, upperTailDepFun) -export(empTailDepFun, lowerEmpTailDepFun, upperEmpTailDepFun) +export(bivTailDepFun, lowerBivTailDepFun, upperBivTailDepFun) +export(empBivTailDepFun, lowerEmpBivTailDepFun, upperEmpBivTailDepFun) # MRP functions export(genEmpKenFun, genInvKenFun) Modified: pkg/R/cqsCopula.R =================================================================== --- pkg/R/cqsCopula.R 2015-08-07 14:09:43 UTC (rev 146) +++ pkg/R/cqsCopula.R 2015-08-14 13:14:05 UTC (rev 147) @@ -402,8 +402,8 @@ setMethod("iRho",signature="cqsCopula", function(copula, rho) { switch(copula at fixed, - a=function(copula, rho) c(a,iRhoCQSec.a(copula at parameters[1],rho)), - b=function(copula, rho) c(iRhoCQSec.b(copula at parameters[2],rho),b), + a=function(copula, rho) c(copula at parameters[1],iRhoCQSec.a(copula at parameters[1],rho)), + b=function(copula, rho) c(iRhoCQSec.b(copula at parameters[2],rho),copula at parameters[2]), stop("iRho may only be used for cqsCopula with one parameter fixed.")) }) Modified: pkg/R/tailDependenceFunctions.R =================================================================== --- pkg/R/tailDependenceFunctions.R 2015-08-07 14:09:43 UTC (rev 146) +++ pkg/R/tailDependenceFunctions.R 2015-08-14 13:14:05 UTC (rev 147) @@ -1,39 +1,45 @@ -# adopted from http://www.r-bloggers.com/copulas-and-tail-dependence-part-1/, 04.11.2013 - -lowerEmpTailDepFun <- function(u) { - empFun <- function(x) sum((u[,1]<=x)&(u[,2]<=x))/sum(u[,1]<=x) - function(x) sapply(x,empFun) -} - -upperEmpTailDepFun <- function(u) { - empFun <- function(x) sum((u[,1]>=x)&(u[,2]>=x))/sum(u[,1]>=x) - function(x) sapply(x,empFun) -} - -empTailDepFun <- function(u) { - function(z) { - res <- z - res[z>0.5] <- upperEmpTailDepFun(u)(z[z>0.5]) - res[z<=0.5] <- lowerEmpTailDepFun(u)(z[z<=0.5]) - return(res) - } -} - -## - -lowerTailDepFun <- function(copula) { - function(z) pCopula(cbind(z,z),copula)/z -} - -upperTailDepFun <- function(copula) { - function(z) (1-2*z+pCopula(cbind(z,z),copula))/(1-z) -} - -tailDepFun <- function(copula) { - function(z) { - res <- z - res[z>0.5] <- upperTailDepFun(copula)(z[z>0.5]) - res[z<=0.5] <- lowerTailDepFun(copula)(z[z<=0.5]) - return(res) - } +# adopted from http://www.r-bloggers.com/copulas-and-tail-dependence-part-1/, 04.11.2013 + +lowerEmpBivTailDepFun <- function(u) { + stopifnot(ncol(u) == 2) + empFun <- function(x) sum((u[,1]<=x)&(u[,2]<=x))/sum(u[,1]<=x) + function(x) sapply(x,empFun) +} + +upperEmpBivTailDepFun <- function(u) { + stopifnot(ncol(u) == 2) + empFun <- function(x) sum((u[,1]>=x)&(u[,2]>=x))/sum(u[,1]>=x) + function(x) sapply(x,empFun) +} + +empBivTailDepFun <- function(u) { + stopifnot(ncol(u) == 2) + + function(z) { + res <- z + res[z>0.5] <- upperEmpBivTailDepFun(u)(z[z>0.5]) + res[z<=0.5] <- lowerEmpBivTailDepFun(u)(z[z<=0.5]) + return(res) + } +} + +## + +lowerBivTailDepFun <- function(copula) { + stopifnot(copula at dimension == 2) + function(z) pCopula(cbind(z,z),copula)/z +} + +upperBivTailDepFun <- function(copula) { + stopifnot(copula at dimension == 2) + function(z) (1-2*z+pCopula(cbind(z,z),copula))/(1-z) +} + +bivTailDepFun <- function(copula) { + function(z) { + res <- z + res[z>0.5] <- upperBivTailDepFun(copula)(z[z>0.5]) + res[z<=0.5] <- lowerBivTailDepFun(copula)(z[z<=0.5]) + return(res) + } } \ No newline at end of file Added: pkg/man/bivTailDepFun.Rd =================================================================== --- pkg/man/bivTailDepFun.Rd (rev 0) +++ pkg/man/bivTailDepFun.Rd 2015-08-14 13:14:05 UTC (rev 147) @@ -0,0 +1,83 @@ +\name{bivTailDepFun} +\alias{bivTailDepFun} +\alias{lowerBivTailDepFun} +\alias{upperBivTailDepFun} + +\alias{empBivTailDepFun} +\alias{lowerEmpBivTailDepFun} +\alias{upperEmpBivTailDepFun} + +\title{ +Tail dependence functions +} +\description{ +Functions returning a (empirical) tail dependence function for a bivariate copula (sample). The tail dependence functions can be upper, lower or joint, where values below 0.5 are calculated from the lower tail dependence function and values larger 0.5 for the upper tail dependence function. The definition follows the one by Nelsen (2006, Theorem 5.4.2.). For tail dependence of multivariate copulas, see the papers by Joe et al. (2010) and Nikoloulopoulos et al. (2012). +} +\usage{ +bivTailDepFun(copula) +lowerBivTailDepFun(copula) +upperBivTailDepFun(copula) + +empBivTailDepFun(u) +lowerEmpBivTailDepFun(u) +upperEmpBivTailDepFun(u) +} + +\arguments{ + \item{copula}{ +an object of class \code{\linkS4class{copula}} +} + \item{u}{ +a bivariate sample on (0,1) +} +} + +\value{ +A function taking arguments from the unit interval (0,1) and returning the corresponding tail index. +} +\references{ +Definition: + +Nelsen, Roger B. An introduction to copulas. Vol. 139. Springer Science & Business Media, 2013. + +Further reading on multivariate tail dependence: + +Joe, Harry, Haijun Li, and Aristidis K. Nikoloulopoulos. "Tail dependence functions and vine copulas." Journal of Multivariate Analysis 101.1 (2010): 252-270. + +Nikoloulopoulos, Aristidis K., Harry Joe, and Haijun Li. "Vine copulas with asymmetric tail dependence and applications to financial return data." Computational Statistics & Data Analysis 56.11 (2012): 3659-3673. + +Plots inspired by: + +\url{http://freakonometrics.blog.free.fr/index.php?post/2012/09/11/Copulas-and-statistical-inference} +} +\author{ +Benedikt Graeler +} + +\examples{ +library("VineCopula") +data("simulatedTriples") +X <- rankTransform(triples[,c(1,3)]) + +tdfEmp <- empBivTailDepFun(X) +plot(tdfEmp,ylim=c(0,1), + ylab="tail dependence index") +abline(v=0.5, col="grey") + +smplTau <- cor(X,method="kendall")[1,2] + +# Gauss +tdfGauss <- bivTailDepFun(normalCopula(sin(smplTau*pi/2))) +curve(tdfGauss,add=TRUE,col="blue") + +# survival Gumbel +tdfGumbel <- bivTailDepFun(surGumbelCopula(1/(1-smplTau))) +curve(tdfGumbel,add=TRUE,col="darkgreen") + +# survival BB6 copula +tdfBB6 <- bivTailDepFun(surBB6Copula(c(4.65,2.28))) +curve(tdfBB6,add=TRUE,col="red") + +legend("bottomleft",c("empircal","Gauss","surv. Gumbel","surv. BB6"), + col=c("black","blue","darkgreen","red"),lty=1) +} \ No newline at end of file Modified: pkg/man/criticalLevel.Rd =================================================================== --- pkg/man/criticalLevel.Rd 2015-08-07 14:09:43 UTC (rev 146) +++ pkg/man/criticalLevel.Rd 2015-08-14 13:14:05 UTC (rev 147) @@ -8,7 +8,7 @@ Kendall distribution or its underlying copula. } \usage{ -criticalLevel(kendallFun = NULL, KRP = c(100, 1000), mu = 1, copula = NULL) +criticalLevel(kendallFun, KRP = c(100, 1000), mu = 1, copula) } \arguments{ \item{kendallFun}{ Modified: pkg/man/kendallRP.Rd =================================================================== --- pkg/man/kendallRP.Rd 2015-08-07 14:09:43 UTC (rev 146) +++ pkg/man/kendallRP.Rd 2015-08-14 13:14:05 UTC (rev 147) @@ -8,7 +8,7 @@ Kendall distribution or its underlying copula. } \usage{ -kendallRP(kendallFun = NULL, cl = c(0.99, 0.999), mu = 1, copula = NULL) +kendallRP(kendallFun, cl = c(0.99, 0.999), mu = 1, copula) } %- maybe also 'usage' for other objects documented here. \arguments{ Deleted: pkg/man/tailDepFun.Rd =================================================================== --- pkg/man/tailDepFun.Rd 2015-08-07 14:09:43 UTC (rev 146) +++ pkg/man/tailDepFun.Rd 2015-08-14 13:14:05 UTC (rev 147) @@ -1,71 +0,0 @@ -\name{tailDepFun} -\alias{tailDepFun} -\alias{lowerTailDepFun} -\alias{upperTailDepFun} - -\alias{empTailDepFun} -\alias{lowerEmpTailDepFun} -\alias{upperEmpTailDepFun} - -\title{ -Tail dependence functions -} -\description{ -Functions returning a (empirical) tail dependence function for a copula (sample). The tail dependence functions can be upper, lower or joint, where values below 0.5 are calculated from the lower tail dependence function and values larger 0.5 for the upper tail dependence function. -} -\usage{ -tailDepFun(copula) -lowerTailDepFun(copula) -upperTailDepFun(copula) - -empTailDepFun(u) -lowerEmpTailDepFun(u) -upperEmpTailDepFun(u) -} - -\arguments{ - \item{copula}{ -an object of class \code{\linkS4class{copula}} -} - \item{u}{ -a bivariate sample on (0,1) -} -} - -\value{ -A function taking arguments from the unit interval (0,1) and returning the corresponding tail index. -} -\references{ -Inspired by: \url{http://freakonometrics.blog.free.fr/index.php?post/2012/09/11/Copulas-and-statistical-inference} -} -\author{ -Benedikt Graeler -} - -\examples{ -library("VineCopula") -data("simulatedTriples") -X <- rankTransform(triples[,c(1,3)]) - -tdfEmp <- empTailDepFun(X) -plot(tdfEmp,ylim=c(0,1), - ylab="tail dependence index") -abline(v=0.5, col="grey") - -smplTau <- cor(X,method="kendall")[1,2] - -# Gauss -tdfGauss <- tailDepFun(normalCopula(sin(smplTau*pi/2))) -curve(tdfGauss,add=TRUE,col="blue") - -# survival Gumbel -tdfGumbel <- tailDepFun(surGumbelCopula(1/(1-smplTau))) -curve(tdfGumbel,add=TRUE,col="darkgreen") - -# survival BB6 copula -tdfBB6 <- tailDepFun(surBB6Copula(c(4.65,2.28))) -curve(tdfBB6,add=TRUE,col="red") - -legend("bottomleft",c("empircal","Gauss","surv. Gumbel","surv. BB6"), - col=c("black","blue","darkgreen","red"),lty=1) -} \ No newline at end of file From noreply at r-forge.r-project.org Tue Aug 18 11:56:11 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 18 Aug 2015 11:56:11 +0200 (CEST) Subject: [spcopula-commits] r148 - / pkg pkg/R pkg/man pkg/tests pkg/tests/Examples Message-ID: <20150818095611.9A0121879B1@r-forge.r-project.org> Author: ben_graeler Date: 2015-08-18 11:56:11 +0200 (Tue, 18 Aug 2015) New Revision: 148 Added: .Rprofile Modified: pkg/DESCRIPTION pkg/NAMESPACE pkg/R/tailDependenceFunctions.R pkg/man/bivTailDepFun.Rd pkg/tests/Examples/spcopula-Ex.Rout.save pkg/tests/spCopulaTest.Rout.save pkg/tests/stCopulaTest.Rout.save Log: - changed (again) naming of tail dependence functions to the more descriptive name bivJointDepFun - the bivariate joint dependence functions - updated Rout.save files Added: .Rprofile =================================================================== --- .Rprofile (rev 0) +++ .Rprofile 2015-08-18 09:56:11 UTC (rev 148) @@ -0,0 +1 @@ +options(repos = c(CRAN="http://cran.uni-muenster.de")) Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2015-08-14 13:14:05 UTC (rev 147) +++ pkg/DESCRIPTION 2015-08-18 09:56:11 UTC (rev 148) @@ -2,7 +2,7 @@ Type: Package Title: Copula Driven Spatio-Temporal Analysis Version: 0.2-1 -Date: 2015-08-14 +Date: 2015-08-18 Authors at R: c(person("Benedikt", "Graeler", role = c("aut", "cre"), email = "ben.graeler at uni-muenster.de"), person("Marius", "Appel",role = "ctb")) Modified: pkg/NAMESPACE =================================================================== --- pkg/NAMESPACE 2015-08-14 13:14:05 UTC (rev 147) +++ pkg/NAMESPACE 2015-08-18 09:56:11 UTC (rev 148) @@ -61,8 +61,8 @@ # fitting export(fitCorFun, loglikByCopulasLags, loglikByCopulasStLags, fitSpCopula, composeSpCopula) -export(bivTailDepFun, lowerBivTailDepFun, upperBivTailDepFun) -export(empBivTailDepFun, lowerEmpBivTailDepFun, upperEmpBivTailDepFun) +export(bivJointDepFun, lowerBivJointDepFun, upperBivJointDepFun) +export(empBivJointDepFun, lowerEmpBivJointDepFun, upperEmpBivJointDepFun) # MRP functions export(genEmpKenFun, genInvKenFun) Modified: pkg/R/tailDependenceFunctions.R =================================================================== --- pkg/R/tailDependenceFunctions.R 2015-08-14 13:14:05 UTC (rev 147) +++ pkg/R/tailDependenceFunctions.R 2015-08-18 09:56:11 UTC (rev 148) @@ -1,45 +1,45 @@ -# adopted from http://www.r-bloggers.com/copulas-and-tail-dependence-part-1/, 04.11.2013 +# adopted from http://freakonometrics.hypotheses.org/2435, -lowerEmpBivTailDepFun <- function(u) { +lowerEmpBivJointDepFun <- function(u) { stopifnot(ncol(u) == 2) empFun <- function(x) sum((u[,1]<=x)&(u[,2]<=x))/sum(u[,1]<=x) function(x) sapply(x,empFun) } -upperEmpBivTailDepFun <- function(u) { +upperEmpBivJointDepFun <- function(u) { stopifnot(ncol(u) == 2) empFun <- function(x) sum((u[,1]>=x)&(u[,2]>=x))/sum(u[,1]>=x) function(x) sapply(x,empFun) } -empBivTailDepFun <- function(u) { +empBivJointDepFun <- function(u) { stopifnot(ncol(u) == 2) function(z) { res <- z - res[z>0.5] <- upperEmpBivTailDepFun(u)(z[z>0.5]) - res[z<=0.5] <- lowerEmpBivTailDepFun(u)(z[z<=0.5]) + res[z>0.5] <- upperEmpBivJointDepFun(u)(z[z>0.5]) + res[z<=0.5] <- lowerEmpBivJointDepFun(u)(z[z<=0.5]) return(res) } } ## -lowerBivTailDepFun <- function(copula) { +lowerBivJointDepFun <- function(copula) { stopifnot(copula at dimension == 2) function(z) pCopula(cbind(z,z),copula)/z } -upperBivTailDepFun <- function(copula) { +upperBivJointDepFun <- function(copula) { stopifnot(copula at dimension == 2) function(z) (1-2*z+pCopula(cbind(z,z),copula))/(1-z) } -bivTailDepFun <- function(copula) { +bivJointDepFun <- function(copula) { function(z) { res <- z - res[z>0.5] <- upperBivTailDepFun(copula)(z[z>0.5]) - res[z<=0.5] <- lowerBivTailDepFun(copula)(z[z<=0.5]) + res[z>0.5] <- upperBivJointDepFun(copula)(z[z>0.5]) + res[z<=0.5] <- lowerBivJointDepFun(copula)(z[z<=0.5]) return(res) } } \ No newline at end of file Modified: pkg/man/bivTailDepFun.Rd =================================================================== --- pkg/man/bivTailDepFun.Rd 2015-08-14 13:14:05 UTC (rev 147) +++ pkg/man/bivTailDepFun.Rd 2015-08-18 09:56:11 UTC (rev 148) @@ -1,26 +1,34 @@ -\name{bivTailDepFun} -\alias{bivTailDepFun} -\alias{lowerBivTailDepFun} -\alias{upperBivTailDepFun} +\name{bivJointDepFun} +\alias{bivJointDepFun} +\alias{lowerBivJointDepFun} +\alias{upperBivJointDepFun} -\alias{empBivTailDepFun} -\alias{lowerEmpBivTailDepFun} -\alias{upperEmpBivTailDepFun} +\alias{empBivJointDepFun} +\alias{lowerEmpBivJointDepFun} +\alias{upperEmpBivJointDepFun} \title{ -Tail dependence functions +Bivariate joint dependence functions } \description{ -Functions returning a (empirical) tail dependence function for a bivariate copula (sample). The tail dependence functions can be upper, lower or joint, where values below 0.5 are calculated from the lower tail dependence function and values larger 0.5 for the upper tail dependence function. The definition follows the one by Nelsen (2006, Theorem 5.4.2.). For tail dependence of multivariate copulas, see the papers by Joe et al. (2010) and Nikoloulopoulos et al. (2012). +Functions returning a (empirical) joint shortfall/exceedance dependence function for a bivariate copula (sample). The functions can be lower (shortfall), upper (exceedance), or both, where values below 0.5 are calculated from the lower joint dependence function and values larger 0.5 from the upper joint dependence function. The definition follows the one by Nelsen for the tail dependence index (2006, Theorem 5.4.2.): + +lower joint dependence (shortfall): +\eqn{\frac{P(U \leq u | V \leq u)}{P(V \leq v)}=\frac{C(u,u)}{u}}{P(U <= u | V <= u)/P(V <= u) = C(u,u)/u} + +upper joint dependence (exceedance): +\eqn{\frac{P(U \geq u | V \geq u)}{P(V \geq v)}=1-2u+\frac{C(u,u)}{1-u}}{P(U >= u | V >= u)/P(V >= u) = 1 - 2u + C(u,u)/(1-u)} + +Taking the limits of the above for \eqn{u \rightarrow 0}{u -> 0} and \eqn{u \rightarrow 1}{u -> 1} respectively yields the lower and upper tail index. For tail dependence of multivariate copulas, see the papers by Joe et al. (2010) and Nikoloulopoulos et al. (2012). } \usage{ -bivTailDepFun(copula) -lowerBivTailDepFun(copula) -upperBivTailDepFun(copula) +bivJointDepFun(copula) +lowerBivJointDepFun(copula) +upperBivJointDepFun(copula) -empBivTailDepFun(u) -lowerEmpBivTailDepFun(u) -upperEmpBivTailDepFun(u) +empBivJointDepFun(u) +lowerEmpBivJointDepFun(u) +upperEmpBivJointDepFun(u) } \arguments{ @@ -33,7 +41,7 @@ } \value{ -A function taking arguments from the unit interval (0,1) and returning the corresponding tail index. +A function taking arguments from the unit interval (0,1) and returning the corresponding index. } \references{ Definition: @@ -48,7 +56,7 @@ Plots inspired by: -\url{http://freakonometrics.blog.free.fr/index.php?post/2012/09/11/Copulas-and-statistical-inference} +\url{http://freakonometrics.hypotheses.org/2435} } \author{ Benedikt Graeler @@ -59,7 +67,7 @@ data("simulatedTriples") X <- rankTransform(triples[,c(1,3)]) -tdfEmp <- empBivTailDepFun(X) +tdfEmp <- empBivJointDepFun(X) plot(tdfEmp,ylim=c(0,1), ylab="tail dependence index") abline(v=0.5, col="grey") @@ -67,15 +75,15 @@ smplTau <- cor(X,method="kendall")[1,2] # Gauss -tdfGauss <- bivTailDepFun(normalCopula(sin(smplTau*pi/2))) +tdfGauss <- bivJointDepFun(normalCopula(sin(smplTau*pi/2))) curve(tdfGauss,add=TRUE,col="blue") # survival Gumbel -tdfGumbel <- bivTailDepFun(surGumbelCopula(1/(1-smplTau))) +tdfGumbel <- bivJointDepFun(surGumbelCopula(1/(1-smplTau))) curve(tdfGumbel,add=TRUE,col="darkgreen") # survival BB6 copula -tdfBB6 <- bivTailDepFun(surBB6Copula(c(4.65,2.28))) +tdfBB6 <- bivJointDepFun(surBB6Copula(c(4.65,2.28))) curve(tdfBB6,add=TRUE,col="red") legend("bottomleft",c("empircal","Gauss","surv. Gumbel","surv. BB6"), Modified: pkg/tests/Examples/spcopula-Ex.Rout.save =================================================================== --- pkg/tests/Examples/spcopula-Ex.Rout.save 2015-08-14 13:14:05 UTC (rev 147) +++ pkg/tests/Examples/spcopula-Ex.Rout.save 2015-08-18 09:56:11 UTC (rev 148) @@ -1,40 +1,27 @@ - -R version 3.2.0 (2015-04-16) -- "Full of Ingredients" -Copyright (C) 2015 The R Foundation for Statistical Computing -Platform: x86_64-w64-mingw32/x64 (64-bit) - -R is free software and comes with ABSOLUTELY NO WARRANTY. -You are welcome to redistribute it under certain conditions. -Type 'license()' or 'licence()' for distribution details. - - Natural language support but running in an English locale - -R is a collaborative project with many contributors. -Type 'contributors()' for more information and -'citation()' on how to cite R or R packages in publications. - -Type 'demo()' for some demos, 'help()' for on-line help, or -'help.start()' for an HTML browser interface to help. -Type 'q()' to quit R. - -> pkgname <- "spcopula" -> source(file.path(R.home("share"), "R", "examples-header.R")) -> options(warn = 1) -> options(pager = "console") -> base::assign(".ExTimings", "spcopula-Ex.timings", pos = 'CheckExEnv') -> base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 'CheckExEnv')) -> base::assign(".format_ptime", -+ function(x) { -+ if(!is.na(x[4L])) x[1L] <- x[1L] + x[4L] -+ if(!is.na(x[5L])) x[2L] <- x[2L] + x[5L] -+ options(OutDec = '.') -+ format(x[1L:3L], digits = 7L) -+ }, -+ pos = 'CheckExEnv') -> -> ### * -> library('spcopula') -Loading required package: copula + +R version 3.2.2 (2015-08-14) -- "Fire Safety" +Copyright (C) 2015 The R Foundation for Statistical Computing +Platform: x86_64-pc-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> pkgname <- "spcopula" +> source(file.path(R.home("share"), "R", "examples-header.R")) +> options(warn = 1) +> library('spcopula') +Loading required package: copula > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > cleanEx() @@ -43,7 +30,6 @@ > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: EU_RB > ### Title: Daily mean PM10 concentrations over Europe in June and July 2005 > ### Aliases: EU_RB @@ -71,7 +57,7 @@ .. .. .. .. ..$ : chr [1:2] "min" "max" .. .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. .. ..@ projargs: chr " +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs" - ..@ time :An 'xts' object on 2005-06-01/2005-07-31 containing: + ..@ time :An ?xts? object on 2005-06-01/2005-07-31 containing: Data: int [1:61, 1] 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 ... - attr(*, "dimnames")=List of 2 ..$ : NULL @@ -83,15 +69,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("EU_RB", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("EU_RB_2005") > ### * EU_RB_2005 > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: EU_RB_2005 > ### Title: Daily mean PM10 concentrations over Europe in 2005 as used in > ### the JSS manuscript @@ -128,7 +111,7 @@ .. .. .. .. ..$ : chr [1:2] "min" "max" .. .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. .. ..@ projargs: chr " +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs" - ..@ time :An 'xts' object on 2005-01-01/2005-12-31 containing: + ..@ time :An ?xts? object on 2005-01-01/2005-12-31 containing: Data: int [1:365, 1] 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 ... - attr(*, "dimnames")=List of 2 ..$ : NULL @@ -140,15 +123,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("EU_RB_2005", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("asCopula-class") > ### * asCopula-class > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: asCopula-class > ### Title: Class '"asCopula"' > ### Aliases: asCopula-class dduCopula,matrix,asCopula-method @@ -177,15 +157,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("asCopula-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("asCopula") > ### * asCopula > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: asCopula > ### Title: Constructor of an asymmetric copula with cubic and quadratic > ### sections (Nelsen 2006). @@ -198,15 +175,56 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("asCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() +> nameEx("bivTailDepFun") +> ### * bivTailDepFun +> +> flush(stderr()); flush(stdout()) +> +> ### Name: bivJointDepFun +> ### Title: Bivariate joint dependence functions +> ### Aliases: bivJointDepFun lowerBivJointDepFun upperBivJointDepFun +> ### empBivJointDepFun lowerEmpBivJointDepFun upperEmpBivJointDepFun +> +> ### ** Examples +> +> library("VineCopula") +> data("simulatedTriples") +> X <- rankTransform(triples[,c(1,3)]) +> +> tdfEmp <- empBivJointDepFun(X) +> plot(tdfEmp,ylim=c(0,1), ++ ylab="tail dependence index") +> abline(v=0.5, col="grey") +> +> smplTau <- cor(X,method="kendall")[1,2] +> +> # Gauss +> tdfGauss <- bivJointDepFun(normalCopula(sin(smplTau*pi/2))) +> curve(tdfGauss,add=TRUE,col="blue") +> +> # survival Gumbel +> tdfGumbel <- bivJointDepFun(surGumbelCopula(1/(1-smplTau))) +> curve(tdfGumbel,add=TRUE,col="darkgreen") +> +> # survival BB6 copula +> tdfBB6 <- bivJointDepFun(surBB6Copula(c(4.65,2.28))) +> curve(tdfBB6,add=TRUE,col="red") +> +> legend("bottomleft",c("empircal","Gauss","surv. Gumbel","surv. BB6"), ++ col=c("black","blue","darkgreen","red"),lty=1) +> +> +> +> cleanEx() + +detaching ?package:VineCopula? + > nameEx("calcBins") > ### * calcBins > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: calcBins > ### Title: A function calculating the spatial/spatio-temporal bins > ### Aliases: calcBins calcBins-methods calcBins,Spatial-method @@ -225,18 +243,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("calcBins", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:sp' +detaching ?package:sp? > nameEx("composeSpCopula") > ### * composeSpCopula > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: composeSpCopula > ### Title: Composing a bivariate Spatial Copula > ### Aliases: composeSpCopula @@ -256,15 +271,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("composeSpCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("condCovariate") > ### * condCovariate > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: condCovariate > ### Title: Conditioning of a Covariate > ### Aliases: condCovariate @@ -293,18 +305,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("condCovariate", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:spacetime', 'package:sp' +detaching ?package:spacetime?, ?package:sp? > nameEx("condSpVine") > ### * condSpVine > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: condSpVine > ### Title: Conditions a spatial vine copula for conditional prediction > ### Aliases: condSpVine @@ -354,18 +363,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("condSpVine", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:VineCopula' +detaching ?package:VineCopula? > nameEx("condStCoVarVine") > ### * condStCoVarVine > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: condStCoVarVine > ### Title: conditional distribution function of spatio-temporal covariate > ### vine copula @@ -403,18 +409,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("condStCoVarVine", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:VineCopula' +detaching ?package:VineCopula? > nameEx("condStVine") > ### * condStVine > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: condStVine > ### Title: Conditions a spatio-temporal vine copula for conditional > ### prediction @@ -450,18 +453,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("condStVine", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:VineCopula' +detaching ?package:VineCopula? > nameEx("cqsCopula-class") > ### * cqsCopula-class > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: cqsCopula-class > ### Title: Class '"cqsCopula"' > ### Aliases: cqsCopula-class dduCopula,matrix,cqsCopula-method @@ -490,15 +490,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("cqsCopula-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("cqsCopula") > ### * cqsCopula > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: cqsCopula > ### Title: Constructor of a symmetric copula with cubic quadratic sections. > ### Aliases: cqsCopula @@ -510,15 +507,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("cqsCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("criticalLevel") > ### * criticalLevel > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: criticalLevel > ### Title: Calculating the critical level for a given Kendall Return Period > ### Aliases: criticalLevel @@ -531,15 +525,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("criticalLevel", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("criticalPair") > ### * criticalPair > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: criticalPair > ### Title: Calculate Critical Pairs > ### Aliases: criticalPair @@ -553,15 +544,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("criticalPair", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("criticalTriple") > ### * criticalTriple > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: criticalTriple > ### Title: calculate critical triples > ### Aliases: criticalTriple @@ -578,15 +566,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("criticalTriple", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("dduCopula") > ### * dduCopula > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: dduCopula > ### Title: partial derivatives of copulas > ### Aliases: dduCopula ddvCopula @@ -624,15 +609,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("dduCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("dependencePlot") > ### * dependencePlot > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: dependencePlot > ### Title: Kernel smoothed scatter plot > ### Aliases: dependencePlot @@ -644,15 +626,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("dependencePlot", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("empiricalCopula-class") > ### * empiricalCopula-class > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: empiricalCopula-class > ### Title: Class '"empiricalCopula"' > ### Aliases: empiricalCopula-class @@ -677,15 +656,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("empiricalCopula-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("empiricalCopula") > ### * empiricalCopula > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: empiricalCopula > ### Title: Constructor of an empirical copula class > ### Aliases: empiricalCopula @@ -737,15 +713,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("empiricalCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("fitCorFun") > ### * fitCorFun > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: fitCorFun > ### Title: Automated fitting of a correlation function to the correlogram > ### Aliases: fitCorFun @@ -791,15 +764,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("fitCorFun", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("fitSpCopula") > ### * fitSpCopula > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: fitSpCopula > ### Title: Spatial Copula Fitting > ### Aliases: fitSpCopula @@ -966,18 +936,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("fitSpCopula", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:sp' +detaching ?package:sp? > nameEx("genEmpCop") > ### * genEmpCop > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: genEmpCop > ### Title: Generate an empirical copula > ### Aliases: genEmpCop @@ -998,15 +965,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("genEmpCop", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("genEmpKenFun") > ### * genEmpKenFun > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: genEmpKenFun > ### Title: Generates an empirical Kendall distribution function > ### Aliases: genEmpKenFun @@ -1020,15 +984,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("genEmpKenFun", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("genInvKenFun") > ### * genInvKenFun > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: genInvKenFun > ### Title: Generate the inverse Kendall distribution function > ### Aliases: genInvKenFun @@ -1046,15 +1007,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("genInvKenFun", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("getKendallDistr") > ### * getKendallDistr > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: getKendallDistr > ### Title: Retrieving the Kendall Distribution function for a given copula > ### Aliases: getKendallDistr getKendallDistr,claytonCopula-method @@ -1072,15 +1030,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("getKendallDistr", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("getNeighbours") > ### * getNeighbours > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: getNeighbours > ### Title: Creating Local Neighbourhoods > ### Aliases: getNeighbours @@ -1099,18 +1054,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("getNeighbours", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:sp' +detaching ?package:sp? > nameEx("getStNeighbours") > ### * getStNeighbours > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: getStNeighbours > ### Title: Creating Local Spatio-Temporal Neighbourhoods > ### Aliases: getStNeighbours @@ -1137,18 +1089,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("getStNeighbours", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:spacetime', 'package:sp' +detaching ?package:spacetime?, ?package:sp? > nameEx("kendallDistribution") > ### * kendallDistribution > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: kendallDistribution > ### Title: The Kendall distribution > ### Aliases: kendallDistribution kendallDistribution,claytonCopula-method @@ -1167,15 +1116,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("kendallDistribution", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("kendallRP") > ### * kendallRP > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: kendallRP > ### Title: calculating the Kendall Return Period > ### Aliases: kendallRP @@ -1188,15 +1134,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("kendallRP", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() > nameEx("loglikByCopulasLags") > ### * loglikByCopulasLags > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: loglikByCopulasLags > ### Title: Log-likelihoods by copula family and spatial lag class > ### Aliases: loglikByCopulasLags @@ -1364,18 +1307,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("loglikByCopulasLags", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:sp' +detaching ?package:sp? > nameEx("loglikByCopulasStLags") > ### * loglikByCopulasStLags > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: loglikByCopulasStLags > ### Title: Log-likelihoods by copula family and spatio-temporal lag class > ### Aliases: loglikByCopulasStLags @@ -1543,18 +1483,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("loglikByCopulasStLags", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:sp' +detaching ?package:sp? > nameEx("neighbourhood-class") > ### * neighbourhood-class > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: neighbourhood-class > ### Title: Class 'neighbourhood' > ### Aliases: neighbourhood-class names,neighbourhood-method @@ -1574,18 +1511,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("neighbourhood-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:sp' +detaching ?package:sp? > nameEx("neighbourhood") > ### * neighbourhood > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: neighbourhood > ### Title: Constructor of the 'neighbourhood' class. > ### Aliases: neighbourhood @@ -1612,18 +1546,15 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("neighbourhood", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") > cleanEx() -detaching 'package:sp' +detaching ?package:sp? > nameEx("qCopula_u") > ### * qCopula_u > > flush(stderr()); flush(stdout()) > -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: qCopula_u > ### Title: The inverse of a bivariate copula given u or v > ### Aliases: qCopula_u qCopula_u,copula-method qCopula_v @@ -1644,15 +1575,12 @@ > > > -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/spcopula -r 148 From noreply at r-forge.r-project.org Tue Aug 18 14:36:53 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 18 Aug 2015 14:36:53 +0200 (CEST) Subject: [spcopula-commits] r149 - pkg/man Message-ID: <20150818123653.C01DF1861AC@r-forge.r-project.org> Author: ben_graeler Date: 2015-08-18 14:36:53 +0200 (Tue, 18 Aug 2015) New Revision: 149 Modified: pkg/man/bivTailDepFun.Rd Log: - fix spelling Modified: pkg/man/bivTailDepFun.Rd =================================================================== --- pkg/man/bivTailDepFun.Rd 2015-08-18 09:56:11 UTC (rev 148) +++ pkg/man/bivTailDepFun.Rd 2015-08-18 12:36:53 UTC (rev 149) @@ -17,9 +17,9 @@ \eqn{\frac{P(U \leq u | V \leq u)}{P(V \leq v)}=\frac{C(u,u)}{u}}{P(U <= u | V <= u)/P(V <= u) = C(u,u)/u} upper joint dependence (exceedance): -\eqn{\frac{P(U \geq u | V \geq u)}{P(V \geq v)}=1-2u+\frac{C(u,u)}{1-u}}{P(U >= u | V >= u)/P(V >= u) = 1 - 2u + C(u,u)/(1-u)} +\eqn{\frac{P(U \geq u | V \geq u)}{P(V \geq v)}=1-2u+\frac{C(u,u)}{1-u}}{P(U >= u | V >= u)/P(V >= u) = (1 - 2u + C(u,u))/(1-u)} -Taking the limits of the above for \eqn{u \rightarrow 0}{u -> 0} and \eqn{u \rightarrow 1}{u -> 1} respectively yields the lower and upper tail index. For tail dependence of multivariate copulas, see the papers by Joe et al. (2010) and Nikoloulopoulos et al. (2012). +Taking the limits of the above for \eqn{u \rightarrow 0}{u -> 0} and \eqn{u \rightarrow 1}{u -> 1} respectively yields the lower and upper tail dependence index. For tail dependence of multivariate copulas, see the papers by Joe et al. (2010) and Nikoloulopoulos et al. (2012). } \usage{ bivJointDepFun(copula) From noreply at r-forge.r-project.org Tue Aug 18 14:48:14 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 18 Aug 2015 14:48:14 +0200 (CEST) Subject: [spcopula-commits] r150 - pkg/man Message-ID: <20150818124814.BEF15187669@r-forge.r-project.org> Author: ben_graeler Date: 2015-08-18 14:48:14 +0200 (Tue, 18 Aug 2015) New Revision: 150 Modified: pkg/man/bivTailDepFun.Rd Log: - fix equation in documentation Modified: pkg/man/bivTailDepFun.Rd =================================================================== --- pkg/man/bivTailDepFun.Rd 2015-08-18 12:36:53 UTC (rev 149) +++ pkg/man/bivTailDepFun.Rd 2015-08-18 12:48:14 UTC (rev 150) @@ -17,7 +17,7 @@ \eqn{\frac{P(U \leq u | V \leq u)}{P(V \leq v)}=\frac{C(u,u)}{u}}{P(U <= u | V <= u)/P(V <= u) = C(u,u)/u} upper joint dependence (exceedance): -\eqn{\frac{P(U \geq u | V \geq u)}{P(V \geq v)}=1-2u+\frac{C(u,u)}{1-u}}{P(U >= u | V >= u)/P(V >= u) = (1 - 2u + C(u,u))/(1-u)} +\eqn{\frac{P(U \geq u | V \geq u)}{P(V \geq v)}=\frac{1-2u+C(u,u)}{1-u}}{P(U >= u | V >= u)/P(V >= u) = (1 - 2u + C(u,u))/(1-u)} Taking the limits of the above for \eqn{u \rightarrow 0}{u -> 0} and \eqn{u \rightarrow 1}{u -> 1} respectively yields the lower and upper tail dependence index. For tail dependence of multivariate copulas, see the papers by Joe et al. (2010) and Nikoloulopoulos et al. (2012). }