[spcopula-commits] r116 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 26 14:37:31 CET 2013


Author: ben_graeler
Date: 2013-11-26 14:37:30 +0100 (Tue, 26 Nov 2013)
New Revision: 116

Added:
   pkg/R/tawnCopula.R
   pkg/man/tawnT1Copula-class.Rd
   pkg/man/tawnT1Copula.Rd
   pkg/man/tawnT2Copula-class.Rd
   pkg/man/tawnT2Copula.Rd
Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/linkingVineCopula.R
   pkg/man/BB1Copula.Rd
Log:
- added support for the two types of Tawn Copulas recently implemented in VineCopula

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2013-11-20 15:27:22 UTC (rev 115)
+++ pkg/DESCRIPTION	2013-11-26 13:37:30 UTC (rev 116)
@@ -38,4 +38,5 @@
   utilities.R
   returnPeriods.R
   spatialGaussianCopula.R
+  tawnCopula.R
   zzz.R

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2013-11-20 15:27:22 UTC (rev 115)
+++ pkg/NAMESPACE	2013-11-26 13:37:30 UTC (rev 116)
@@ -11,6 +11,8 @@
 export(joeBiCopula, surJoeBiCopula, r90JoeBiCopula, r270JoeBiCopula)
 export(surClaytonCopula, r90ClaytonCopula, r270ClaytonCopula)
 export(surGumbelCopula, r90GumbelCopula, r270GumbelCopula)
+export(tawnT1Copula, surTawnT1Copula, r90TawnT1Copula, r270TawnT1Copula)
+export(tawnT2Copula, surTawnT2Copula, r90TawnT2Copula, r270TawnT2Copula)
 export(spCopula, stCopula)
 export(vineCopula, spVineCopula, stVineCopula)
 export(neighbourhood, stNeighbourhood)

Modified: pkg/R/linkingVineCopula.R
===================================================================
--- pkg/R/linkingVineCopula.R	2013-11-20 15:27:22 UTC (rev 115)
+++ pkg/R/linkingVineCopula.R	2013-11-26 13:37:30 UTC (rev 116)
@@ -1,21 +1,45 @@
 copulaFromFamilyIndex <- function(family, par, par2=0) {
-  constr <- switch(family+1, function(par) indepCopula(), 
-                   function(par) normalCopula(par[1]), function(par) tCopula(par[1],df=par[2]),
-                   function(par) claytonCopula(par[1]), function(par) gumbelCopula(par[1]),
-                   function(par) frankCopula(par[1]), function(par) joeBiCopula(par[1]),
-                   BB1Copula, BB6Copula, BB7Copula, BB8Copula, 
-                   NULL, NULL,
-                   function(par) surClaytonCopula(par[1]), function(par) surGumbelCopula(par[1]),
-                   NULL, function(par) surJoeBiCopula(par[1]),
-                   surBB1Copula, surBB6Copula, surBB7Copula, surBB8Copula, 
-                   NULL, NULL,
-                   function(par) r90ClaytonCopula(par[1]), function(par) r90GumbelCopula(par[1]),
-                   NULL, function(par) r90JoeBiCopula(par[1]),
-                   r90BB1Copula, r90BB6Copula, r90BB7Copula, r90BB8Copula, 
-                   NULL, NULL,
-                   function(par) r270ClaytonCopula(par[1]), function(par) r270GumbelCopula(par[1]),
-                   NULL, function(par) r270JoeBiCopula(par[1]),
-                   r270BB1Copula, r270BB6Copula, r270BB7Copula, r270BB8Copula)
+  constr <- switch(paste("fam",family,sep=""),
+                   fam0 = function(par) indepCopula(), 
+                   fam1 = function(par) normalCopula(par[1]),
+                   fam2 = function(par) tCopula(par[1],df=par[2]),
+                   fam3 = function(par) claytonCopula(par[1]),
+                   fam4 = function(par) gumbelCopula(par[1]),
+                   fam5 = function(par) frankCopula(par[1]), 
+                   fam6 = function(par) joeBiCopula(par[1]),
+                   fam7 = BB1Copula,
+                   fam8 = BB6Copula, 
+                   fam9 = BB7Copula, 
+                   fam10 = BB8Copula, 
+                   fam13 = function(par) surClaytonCopula(par[1]), 
+                   fam14 = function(par) surGumbelCopula(par[1]),
+                   fam16 = function(par) surJoeBiCopula(par[1]),
+                   fam17 = surBB1Copula, 
+                   fam18 = surBB6Copula, 
+                   fam19 = surBB7Copula, 
+                   fam20 = surBB8Copula, 
+                   fam23 = function(par) r90ClaytonCopula(par[1]),
+                   fam24 = function(par) r90GumbelCopula(par[1]),
+                   fam26 = function(par) r90JoeBiCopula(par[1]),
+                   fam27 = r90BB1Copula,
+                   fam28 = r90BB6Copula,
+                   fam29 = r90BB7Copula, 
+                   fam30 = r90BB8Copula, 
+                   fam33 = function(par) r270ClaytonCopula(par[1]),
+                   fam34 = function(par) r270GumbelCopula(par[1]),
+                   fam36 = function(par) r270JoeBiCopula(par[1]),
+                   fam37 = r270BB1Copula, 
+                   fam38 = r270BB6Copula, 
+                   fam39 = r270BB7Copula, 
+                   fam40 = r270BB8Copula, 
+                   fam104 = tawnT1Copula,
+                   fam114 = surTawnT1Copula,
+                   fam124 = r90TawnT1Copula,
+                   fam134 = r270TawnT1Copula,
+                   fam204 = tawnT2Copula,
+                   fam214 = surTawnT2Copula,
+                   fam224 = r90TawnT2Copula,
+                   fam234 = r270TawnT2Copula)
   constr(c(par,par2))
 }
 

Added: pkg/R/tawnCopula.R
===================================================================
--- pkg/R/tawnCopula.R	                        (rev 0)
+++ pkg/R/tawnCopula.R	2013-11-26 13:37:30 UTC (rev 116)
@@ -0,0 +1,456 @@
+#########################
+##                     ##
+## Tawn type 1 copulas ##
+##                     ##
+#########################
+
+validTawnCopula = function(object) {
+  if (object at dimension != 2)
+    return("Only Tawn copulas of dimension 2 are supported.")
+  param <- object at parameters
+  upper <- object at param.upbnd
+  lower <- object at param.lowbnd
+  if (length(param) != length(upper))
+    return("Parameter and upper bound have non-equal length")
+  if (length(param) != length(lower))
+    return("Parameter and lower bound have non-equal length")
+  else return (TRUE)
+}
+
+setClass("tawnT1Copula",
+  representation = representation("copula", family="numeric"),
+  validity = validTawnCopula,
+  contains = list("copula")
+)
+
+# constructor
+tawnT1Copula <- function (param=c(2,0.5)) {
+  if (any(is.na(param) | param < c(1,0) | param[1] == Inf | param[2] > 1))
+    stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1]."))
+  new("tawnT1Copula", dimension = as.integer(2), parameters = param, 
+      param.names = c("param1", "param2"), param.lowbnd = c(1, 0), param.upbnd = c(Inf, 1),
+      family=104, fullname = "Tawn type 1 copula family. Number 104 in VineCopula.")
+}
+
+## density ##
+setMethod("dCopula", signature("numeric","tawnT1Copula"), 
+          function(u, copula, log) {
+            linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
+          })
+setMethod("dCopula", signature("matrix","tawnT1Copula"), 
+          function(u, copula, log) linkVineCop.PDF(u, copula, log))
+
+## jcdf ##
+setMethod("pCopula", signature("numeric","tawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("pCopula", signature("matrix","tawnT1Copula"), linkVineCop.CDF)
+
+## partial derivatives ##
+# ddu
+setMethod("dduCopula", signature("numeric","tawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("dduCopula", signature("matrix","tawnT1Copula"), linkVineCop.ddu)
+
+# ddv
+setMethod("ddvCopula", signature("numeric","tawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("ddvCopula", signature("matrix","tawnT1Copula"), linkVineCop.ddv)
+
+## random number generator
+setMethod("rCopula", signature("numeric","tawnT1Copula"), linkVineCop.r)
+
+setMethod("tau",signature("tawnT1Copula"),linkVineCop.tau)
+setMethod("tailIndex",signature("tawnT1Copula"),linkVineCop.tailIndex)
+
+#################################
+## Tawn type 1 survival copula ##
+#################################
+
+setClass("surTawnT1Copula",
+         representation = representation("copula", family="numeric"),
+         validity = validTawnCopula,
+         contains = list("copula")
+)
+
+# constructor
+surTawnT1Copula <- function (param=c(2,0.5)) {
+  if (any(is.na(param) | param < c(1,0) | param[1] == Inf | param[2] > 1))
+    stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1]."))
+  new("surTawnT1Copula", dimension = as.integer(2), parameters = param, 
+      param.names = c("param1", "param2"), param.lowbnd = c(1, 0), param.upbnd = c(Inf, 1),
+      family=114, fullname = "Survival Tawn type 1 copula family. Number 114 in VineCopula.")
+}
+
+## density ##
+setMethod("dCopula", signature("numeric","surTawnT1Copula"), 
+          function(u, copula, log) {
+            linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
+          })
+setMethod("dCopula", signature("matrix","surTawnT1Copula"), 
+          function(u, copula, log) linkVineCop.PDF(u, copula, log))
+
+## jcdf ##
+setMethod("pCopula", signature("numeric","surTawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("pCopula", signature("matrix","surTawnT1Copula"), linkVineCop.CDF)
+
+## partial derivatives ##
+# ddu
+setMethod("dduCopula", signature("numeric","surTawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("dduCopula", signature("matrix","surTawnT1Copula"), linkVineCop.ddu)
+
+# ddv
+setMethod("ddvCopula", signature("numeric","surTawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("ddvCopula", signature("matrix","surTawnT1Copula"), linkVineCop.ddv)
+
+## random number generator
+setMethod("rCopula", signature("numeric","surTawnT1Copula"), linkVineCop.r)
+
+setMethod("tau",signature("surTawnT1Copula"),linkVineCop.tau)
+setMethod("tailIndex",signature("surTawnT1Copula"),linkVineCop.tailIndex)
+
+#######################################
+## Tawn type 1 90 deg. rotate copula ##
+#######################################
+
+setClass("r90TawnT1Copula",
+         representation = representation("copula", family="numeric"),
+         validity = validTawnCopula,
+         contains = list("copula")
+)
+
+# constructor
+r90TawnT1Copula <- function (param=c(-2, 0.5)) {
+  if (any(is.na(param) | param[1] == -Inf | param[1] > -1 | param[2] < 0 | param[2] > 1))
+    stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1]."))
+  new("r90TawnT1Copula", dimension = as.integer(2), parameters = param, 
+      param.names = c("param1", "param2"), param.lowbnd = c(-Inf, 0), param.upbnd = c(-1, 1),
+      family=124, fullname = "Survival Tawn type 1 copula family. Number 124 in VineCopula.")
+}
+
+## density ##
+setMethod("dCopula", signature("numeric","r90TawnT1Copula"), 
+          function(u, copula, log) {
+            linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
+          })
+setMethod("dCopula", signature("matrix","r90TawnT1Copula"), 
+          function(u, copula, log) linkVineCop.PDF(u, copula, log))
+
+## jcdf ##
+setMethod("pCopula", signature("numeric","r90TawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("pCopula", signature("matrix","r90TawnT1Copula"), linkVineCop.CDF)
+
+## partial derivatives ##
+# ddu
+setMethod("dduCopula", signature("numeric","r90TawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("dduCopula", signature("matrix","r90TawnT1Copula"), linkVineCop.ddu)
+
+# ddv
+setMethod("ddvCopula", signature("numeric","r90TawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("ddvCopula", signature("matrix","r90TawnT1Copula"), linkVineCop.ddv)
+
+## random number generator
+setMethod("rCopula", signature("numeric","r90TawnT1Copula"), linkVineCop.r)
+
+setMethod("tau",signature("r90TawnT1Copula"),linkVineCop.tau)
+setMethod("tailIndex",signature("r90TawnT1Copula"),linkVineCop.tailIndex)
+
+########################################
+## Tawn type 1 270 deg. rotate copula ##
+########################################
+
+setClass("r270TawnT1Copula",
+         representation = representation("copula", family="numeric"),
+         validity = validTawnCopula,
+         contains = list("copula")
+)
+
+# constructor
+r270TawnT1Copula <- function (param=c(-2, 0.5)) {
+  if (any(is.na(param) | param[1] == -Inf | param[1] > -1 | param[2] < 0 | param[2] > 1))
+    stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1]."))
+  new("r270TawnT1Copula", dimension = as.integer(2), parameters = param, 
+      param.names = c("param1", "param2"), param.lowbnd = c(-Inf, 0), param.upbnd = c(-1, 1),
+      family=134, fullname = "Survival Tawn type 1 copula family. Number 134 in VineCopula.")
+}
+
+## density ##
+setMethod("dCopula", signature("numeric","r270TawnT1Copula"), 
+          function(u, copula, log) {
+            linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
+          })
+setMethod("dCopula", signature("matrix","r270TawnT1Copula"), 
+          function(u, copula, log) linkVineCop.PDF(u, copula, log))
+
+## jcdf ##
+setMethod("pCopula", signature("numeric","r270TawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("pCopula", signature("matrix","r270TawnT1Copula"), linkVineCop.CDF)
+
+## partial derivatives ##
+# ddu
+setMethod("dduCopula", signature("numeric","r270TawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("dduCopula", signature("matrix","r270TawnT1Copula"), linkVineCop.ddu)
+
+# ddv
+setMethod("ddvCopula", signature("numeric","r270TawnT1Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("ddvCopula", signature("matrix","r270TawnT1Copula"), linkVineCop.ddv)
+
+## random number generator
+setMethod("rCopula", signature("numeric","r270TawnT1Copula"), linkVineCop.r)
+
+setMethod("tau",signature("r270TawnT1Copula"),linkVineCop.tau)
+setMethod("tailIndex",signature("r270TawnT1Copula"),linkVineCop.tailIndex)
+
+#########################
+##                     ##
+## Tawn type 2 copulas ##
+##                     ##
+#########################
+
+setClass("tawnT2Copula",
+         representation = representation("copula", family="numeric"),
+         validity = validTawnCopula,
+         contains = list("copula")
+)
+
+# constructor
+tawnT2Copula <- function (param=c(2,0.5)) {
+  if (any(is.na(param) | param < c(1,0) | param[1] == Inf | param[2] > 1))
+    stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1]."))
+  new("tawnT2Copula", dimension = as.integer(2), parameters = param, 
+      param.names = c("param1", "param2"), param.lowbnd = c(1, 0), param.upbnd = c(Inf, 1),
+      family=204, fullname = "Tawn type 2 copula family. Number 204 in VineCopula.")
+}
+
+## density ##
+setMethod("dCopula", signature("numeric","tawnT2Copula"), 
+          function(u, copula, log) {
+            linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
+          })
+setMethod("dCopula", signature("matrix","tawnT2Copula"), 
+          function(u, copula, log) linkVineCop.PDF(u, copula, log))
+
+## jcdf ##
+setMethod("pCopula", signature("numeric","tawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("pCopula", signature("matrix","tawnT2Copula"), linkVineCop.CDF)
+
+## partial derivatives ##
+# ddu
+setMethod("dduCopula", signature("numeric","tawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("dduCopula", signature("matrix","tawnT2Copula"), linkVineCop.ddu)
+
+# ddv
+setMethod("ddvCopula", signature("numeric","tawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("ddvCopula", signature("matrix","tawnT2Copula"), linkVineCop.ddv)
+
+## random number generator
+setMethod("rCopula", signature("numeric","tawnT2Copula"), linkVineCop.r)
+
+setMethod("tau",signature("tawnT2Copula"),linkVineCop.tau)
+setMethod("tailIndex",signature("tawnT2Copula"),linkVineCop.tailIndex)
+
+#################################
+## Tawn type 1 survival copula ##
+#################################
+
+setClass("surTawnT2Copula",
+         representation = representation("copula", family="numeric"),
+         validity = validTawnCopula,
+         contains = list("copula")
+)
+
+# constructor
+surTawnT2Copula <- function (param=c(2,0.5)) {
+  if (any(is.na(param) | param < c(1,0) | param[1] == Inf | param[2] > 1))
+    stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1]."))
+  new("surTawnT2Copula", dimension = as.integer(2), parameters = param, 
+      param.names = c("param1", "param2"), param.lowbnd = c(1, 0), param.upbnd = c(Inf, 1),
+      family=214, fullname = "Survival Tawn type 2 copula family. Number 214 in VineCopula.")
+}
+
+## density ##
+setMethod("dCopula", signature("numeric","surTawnT2Copula"), 
+          function(u, copula, log) {
+            linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
+          })
+setMethod("dCopula", signature("matrix","surTawnT2Copula"), 
+          function(u, copula, log) linkVineCop.PDF(u, copula, log))
+
+## jcdf ##
+setMethod("pCopula", signature("numeric","surTawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("pCopula", signature("matrix","surTawnT2Copula"), linkVineCop.CDF)
+
+## partial derivatives ##
+# ddu
+setMethod("dduCopula", signature("numeric","surTawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("dduCopula", signature("matrix","surTawnT2Copula"), linkVineCop.ddu)
+
+# ddv
+setMethod("ddvCopula", signature("numeric","surTawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("ddvCopula", signature("matrix","surTawnT2Copula"), linkVineCop.ddv)
+
+## random number generator
+setMethod("rCopula", signature("numeric","surTawnT2Copula"), linkVineCop.r)
+
+setMethod("tau",signature("surTawnT2Copula"),linkVineCop.tau)
+setMethod("tailIndex",signature("surTawnT2Copula"),linkVineCop.tailIndex)
+
+#######################################
+## Tawn type 1 90 deg. rotate copula ##
+#######################################
+
+setClass("r90TawnT2Copula",
+         representation = representation("copula", family="numeric"),
+         validity = validTawnCopula,
+         contains = list("copula")
+)
+
+# constructor
+r90TawnT2Copula <- function (param=c(-2, 0.5)) {
+  if (any(is.na(param) | param[1] == -Inf | param[1] > -1 | param[2] < 0 | param[2] > 1))
+    stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1]."))
+  new("r90TawnT2Copula", dimension = as.integer(2), parameters = param, 
+      param.names = c("param1", "param2"), param.lowbnd = c(-Inf, 0), param.upbnd = c(-1, 1),
+      family=224, fullname = "Survival Tawn type 2 copula family. Number 224 in VineCopula.")
+}
+
+## density ##
+setMethod("dCopula", signature("numeric","r90TawnT2Copula"), 
+          function(u, copula, log) {
+            linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
+          })
+setMethod("dCopula", signature("matrix","r90TawnT2Copula"), 
+          function(u, copula, log) linkVineCop.PDF(u, copula, log))
+
+## jcdf ##
+setMethod("pCopula", signature("numeric","r90TawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("pCopula", signature("matrix","r90TawnT2Copula"), linkVineCop.CDF)
+
+## partial derivatives ##
+# ddu
+setMethod("dduCopula", signature("numeric","r90TawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("dduCopula", signature("matrix","r90TawnT2Copula"), linkVineCop.ddu)
+
+# ddv
+setMethod("ddvCopula", signature("numeric","r90TawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("ddvCopula", signature("matrix","r90TawnT2Copula"), linkVineCop.ddv)
+
+## random number generator
+setMethod("rCopula", signature("numeric","r90TawnT2Copula"), linkVineCop.r)
+
+setMethod("tau",signature("r90TawnT2Copula"),linkVineCop.tau)
+setMethod("tailIndex",signature("r90TawnT2Copula"),linkVineCop.tailIndex)
+
+########################################
+## Tawn type 1 270 deg. rotate copula ##
+########################################
+
+setClass("r270TawnT2Copula",
+         representation = representation("copula", family="numeric"),
+         validity = validTawnCopula,
+         contains = list("copula")
+)
+
+# constructor
+r270TawnT2Copula <- function (param=c(-2, 0.5)) {
+  if (any(is.na(param) | param[1] == -Inf | param[1] > -1 | param[2] < 0 | param[2] > 1))
+    stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1]."))
+  new("r270TawnT2Copula", dimension = as.integer(2), parameters = param, 
+      param.names = c("param1", "param2"), param.lowbnd = c(-Inf, 0), param.upbnd = c(-1, 1),
+      family=234, fullname = "Survival Tawn type 2 copula family. Number 234 in VineCopula.")
+}
+
+## density ##
+setMethod("dCopula", signature("numeric","r270TawnT2Copula"), 
+          function(u, copula, log) {
+            linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
+          })
+setMethod("dCopula", signature("matrix","r270TawnT2Copula"), 
+          function(u, copula, log) linkVineCop.PDF(u, copula, log))
+
+## jcdf ##
+setMethod("pCopula", signature("numeric","r270TawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("pCopula", signature("matrix","r270TawnT2Copula"), linkVineCop.CDF)
+
+## partial derivatives ##
+# ddu
+setMethod("dduCopula", signature("numeric","r270TawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("dduCopula", signature("matrix","r270TawnT2Copula"), linkVineCop.ddu)
+
+# ddv
+setMethod("ddvCopula", signature("numeric","r270TawnT2Copula"), 
+          function(u, copula, ...) {
+            linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
+          })
+setMethod("ddvCopula", signature("matrix","r270TawnT2Copula"), linkVineCop.ddv)
+
+## random number generator
+setMethod("rCopula", signature("numeric","r270TawnT2Copula"), linkVineCop.r)
+
+setMethod("tau",signature("r270TawnT2Copula"),linkVineCop.tau)
+setMethod("tailIndex",signature("r270TawnT2Copula"),linkVineCop.tailIndex)

Modified: pkg/man/BB1Copula.Rd
===================================================================
--- pkg/man/BB1Copula.Rd	2013-11-20 15:27:22 UTC (rev 115)
+++ pkg/man/BB1Copula.Rd	2013-11-26 13:37:30 UTC (rev 116)
@@ -5,10 +5,10 @@
 \alias{r270BB1Copula}
 
 \title{
-Constructor of the BB1 family and its derivatives
+Constructor of the BB1 family and rotated versions thereof
 }
 \description{
-Constructs an object of the \code{\linkS4class{BB1Copula}} (survival \code{sur}, 90 degree rotated \code{r90} and 270 degree rotated \code{r270}) family for a given parameter.
+Constructs an object of the \code{\linkS4class{BB1Copula}} (survival \code{sur}, 90 degree rotated \code{r90} and 270 degree rotated \code{r270}) family for given parameters.
 }
 \usage{
 BB1Copula(param)
@@ -39,4 +39,7 @@
 persp(surBB1Copula(c(1,1.5)),dCopula, zlim=c(0,10))
 persp(r90BB1Copula(c(-1,-1.5)),dCopula, zlim=c(0,10))
 persp(r270BB1Copula(c(-1,-1.5)),dCopula, zlim=c(0,10))
-}
\ No newline at end of file
+}
+
+\keyword{ distribution }
+\keyword{ copula } 

Added: pkg/man/tawnT1Copula-class.Rd
===================================================================
--- pkg/man/tawnT1Copula-class.Rd	                        (rev 0)
+++ pkg/man/tawnT1Copula-class.Rd	2013-11-26 13:37:30 UTC (rev 116)
@@ -0,0 +1,76 @@
+\name{tawnT1Copula-class}
+\Rdversion{1.1}
+\docType{class}
+\alias{tawnT1Copula-class}
+\alias{dduCopula,matrix,tawnT1Copula-method}
+\alias{dduCopula,numeric,tawnT1Copula-method}
+\alias{ddvCopula,matrix,tawnT1Copula-method}
+\alias{ddvCopula,numeric,tawnT1Copula-method}
+
+\alias{surTawnT1Copula-class}
+\alias{dduCopula,matrix,surTawnT1Copula-method}
+\alias{dduCopula,numeric,surTawnT1Copula-method}
+\alias{ddvCopula,matrix,surTawnT1Copula-method}
+\alias{ddvCopula,numeric,surTawnT1Copula-method}
+
+\alias{r90TawnT1Copula-class}
+\alias{dduCopula,matrix,r90TawnT1Copula-method}
+\alias{dduCopula,numeric,r90TawnT1Copula-method}
+\alias{ddvCopula,matrix,r90TawnT1Copula-method}
+\alias{ddvCopula,numeric,r90TawnT1Copula-method}
+
+\alias{r270TawnT1Copula-class}
+\alias{dduCopula,matrix,r270TawnT1Copula-method}
+\alias{dduCopula,numeric,r270TawnT1Copula-method}
+\alias{ddvCopula,matrix,r270TawnT1Copula-method}
+\alias{ddvCopula,numeric,r270TawnT1Copula-method}
+
+\title{Class \code{"tawnT1Copula"}}
+\description{
+S4-class representation of the Tawn Copula family of type 1 and rotated versions there of.
+}
+\section{Objects from the Class}{
+Objects can be created by calls of the form \code{new("tawnT1Copula", ...)}, or through the explicit constructors \code{\link{tawnT1Copula}}, \code{\link{surTawnT1Copula}}, \code{\link{r90TawnT1Copula}} and \code{\link{r270TawnT1Copula}} respectively.}
+
+\section{Slots}{
+  \describe{
+    \item{\code{family}:}{Object of class \code{"numeric"} providing the unique number in VineCopula.}
+    \item{\code{dimension}:}{Object of class \code{"integer"} and fixed to \code{2L}.}
+    \item{\code{parameters}:}{Object of class \code{"numeric"} representing the two parameters.}
+    \item{\code{param.names}:}{Object of class \code{"character"} providing the names of the parameters.}
+    \item{\code{param.lowbnd}:}{Object of class \code{"numeric"} providing the lower bounds of the parameters.}
+    \item{\code{param.upbnd}:}{Object of class \code{"numeric"} providing the upper bounds of the parameters.}
+    \item{\code{fullname}:}{Object of class \code{"character"} providing a textual summary of the copula class.}
+  }
+}
+\section{Extends}{
+Class \code{"\linkS4class{copula}"}, directly.
+Class \code{"\linkS4class{Copula}"}, by class "copula", distance 2.
+}
+\section{Methods}{
+  \describe{
+    \item{dCopula}{\code{signature(u = "matrix", copula = "tawnT1Copula")}: ... }
+    \item{dCopula}{\code{signature(u = "numeric", copula = "tawnT1Copula")}: ... }
+    \item{dduCopula}{\code{signature(u = "matrix", copula = "tawnT1Copula")}: ... }
+    \item{dduCopula}{\code{signature(u = "numeric", copula = "tawnT1Copula")}: ... }
+    \item{ddvCopula}{\code{signature(u = "matrix", copula = "tawnT1Copula")}: ... }
+    \item{ddvCopula}{\code{signature(u = "numeric", copula = "tawnT1Copula")}: ... }
+    \item{pCopula}{\code{signature(u = "matrix", copula = "tawnT1Copula")}: ... }
+    \item{pCopula}{\code{signature(u = "numeric", copula = "tawnT1Copula")}: ... }
+    \item{rCopula}{\code{signature(n = "numeric", copula = "tawnT1Copula")}: ... }
+    \item{tailIndex}{\code{signature(copula = "tawnT1Copula")}: ... }
+    \item{tau}{\code{signature(copula = "tawnT1Copula")}: ... }
+	 }
+}
+
+\author{
+Benedikt Graeler
+}
+
+\seealso{
+\code{\linkS4class{tawnT2Copula}} and the package \code{\link{VineCopula-package}} for implementation details.
+}
+\examples{
+showClass("tawnT1Copula")
+}
+\keyword{classes}

Added: pkg/man/tawnT1Copula.Rd
===================================================================
--- pkg/man/tawnT1Copula.Rd	                        (rev 0)
+++ pkg/man/tawnT1Copula.Rd	2013-11-26 13:37:30 UTC (rev 116)
@@ -0,0 +1,44 @@
+\name{tawnT1Copula}
+\alias{tawnT1Copula}
+\alias{surTawnT1Copula}
+\alias{r90TawnT1Copula}
+\alias{r270TawnT1Copula}
+
+\title{
+Constructor of the Tawn type 1 family and rotated versions thereof
+}
+\description{
+Constructs an object of the \code{\linkS4class{tawnT1Copula}} (survival \code{sur}, 90 degree rotated \code{r90} and 270 degree rotated \code{r270}) family for given parameters.
+}
+\usage{
+tawnT1Copula(param = c(2, 0.5))
+surTawnT1Copula(param = c(2, 0.5))
+r90TawnT1Copula(param = c(-2, 0.5))
+r270TawnT1Copula(param = c(-2, 0.5))
+}
+
+\arguments{
+  \item{param}{
+The parameter \code{param} defines the copula through \code{param1} and \code{param2}.
+}
+}
+
+\value{
+One of the Tawn type 1 copula classes (\code{\linkS4class{tawnT1Copula}}, \code{\linkS4class{surTawnT1Copula}}, \code{\linkS4class{r90TawnT1Copula}}, \code{\linkS4class{r270TawnT1Copula}}).
+}
+
+\author{
+Benedikt Graeler
+}
+
+\seealso{
+\code{\link{tawnT2Copula}} and the package \code{\link{VineCopula-package}} for implementation details.
+}
+\examples{
+persp(tawnT1Copula(),dCopula, zlim=c(0,10))
+persp(surTawnT1Copula(),dCopula, zlim=c(0,10))
+persp(r90TawnT1Copula(),dCopula, zlim=c(0,10))
+persp(r270TawnT1Copula(),dCopula, zlim=c(0,10))
+}
+\keyword{ distribution }
+\keyword{ copula } 

Added: pkg/man/tawnT2Copula-class.Rd
===================================================================
--- pkg/man/tawnT2Copula-class.Rd	                        (rev 0)
+++ pkg/man/tawnT2Copula-class.Rd	2013-11-26 13:37:30 UTC (rev 116)
@@ -0,0 +1,76 @@
+\name{tawnT2Copula-class}
+\Rdversion{1.1}
+\docType{class}
+\alias{tawnT2Copula-class}
+\alias{dduCopula,matrix,tawnT2Copula-method}
+\alias{dduCopula,numeric,tawnT2Copula-method}
+\alias{ddvCopula,matrix,tawnT2Copula-method}
+\alias{ddvCopula,numeric,tawnT2Copula-method}
+
+\alias{surTawnT2Copula-class}
+\alias{dduCopula,matrix,surTawnT2Copula-method}
+\alias{dduCopula,numeric,surTawnT2Copula-method}
+\alias{ddvCopula,matrix,surTawnT2Copula-method}
+\alias{ddvCopula,numeric,surTawnT2Copula-method}
+
+\alias{r90TawnT2Copula-class}
+\alias{dduCopula,matrix,r90TawnT2Copula-method}
+\alias{dduCopula,numeric,r90TawnT2Copula-method}
+\alias{ddvCopula,matrix,r90TawnT2Copula-method}
+\alias{ddvCopula,numeric,r90TawnT2Copula-method}
+
+\alias{r270TawnT2Copula-class}
+\alias{dduCopula,matrix,r270TawnT2Copula-method}
+\alias{dduCopula,numeric,r270TawnT2Copula-method}
+\alias{ddvCopula,matrix,r270TawnT2Copula-method}
+\alias{ddvCopula,numeric,r270TawnT2Copula-method}
+
+\title{Class \code{"tawnT2Copula"}}
+\description{
+S4-class representation of the Tawn Copula family of type 2 and rotated versions there of.
+}
+\section{Objects from the Class}{
+Objects can be created by calls of the form \code{new("tawnT2Copula", ...)}, or through the explicit constructors \code{\link{tawnT2Copula}}, \code{\link{surTawnT2Copula}}, \code{\link{r90TawnT2Copula}} and \code{\link{r270TawnT2Copula}} respectively.
+}
+\section{Slots}{
+  \describe{
+    \item{\code{family}:}{Object of class \code{"numeric"} providing the unique number in VineCopula.}
+    \item{\code{dimension}:}{Object of class \code{"integer"} and fixed to \code{2L}.}
+    \item{\code{parameters}:}{Object of class \code{"numeric"} representing the two parameters.}
+    \item{\code{param.names}:}{Object of class \code{"character"} providing the names of the parameters.}
+    \item{\code{param.lowbnd}:}{Object of class \code{"numeric"} providing the lower bounds of the parameters.}
+    \item{\code{param.upbnd}:}{Object of class \code{"numeric"} providing the upper bounds of the parameters.}
+    \item{\code{fullname}:}{Object of class \code{"character"} providing a textual summary of the copula class.}
+  }
+}
+\section{Extends}{
+Class \code{"\linkS4class{copula}"}, directly.
+Class \code{"\linkS4class{Copula}"}, by class "copula", distance 2.
+}
+\section{Methods}{
+  \describe{
+    \item{dCopula}{\code{signature(u = "matrix", copula = "tawnT2Copula")}: ... }
+    \item{dCopula}{\code{signature(u = "numeric", copula = "tawnT2Copula")}: ... }
+    \item{dduCopula}{\code{signature(u = "matrix", copula = "tawnT2Copula")}: ... }
+    \item{dduCopula}{\code{signature(u = "numeric", copula = "tawnT2Copula")}: ... }
+    \item{ddvCopula}{\code{signature(u = "matrix", copula = "tawnT2Copula")}: ... }
+    \item{ddvCopula}{\code{signature(u = "numeric", copula = "tawnT2Copula")}: ... }
+    \item{pCopula}{\code{signature(u = "matrix", copula = "tawnT2Copula")}: ... }
+    \item{pCopula}{\code{signature(u = "numeric", copula = "tawnT2Copula")}: ... }
+    \item{rCopula}{\code{signature(n = "numeric", copula = "tawnT2Copula")}: ... }
+    \item{tailIndex}{\code{signature(copula = "tawnT2Copula")}: ... }
+    \item{tau}{\code{signature(copula = "tawnT2Copula")}: ... }
+	 }
+}
+
+\author{
+Benedikt Graeler
+}
+
+\seealso{
+\code{\linkS4class{tawnT1Copula}} and the package \code{\link{VineCopula-package}} for implementation details.
+}
+\examples{
+showClass("tawnT2Copula")
+}
+\keyword{classes}

Added: pkg/man/tawnT2Copula.Rd
===================================================================
--- pkg/man/tawnT2Copula.Rd	                        (rev 0)
+++ pkg/man/tawnT2Copula.Rd	2013-11-26 13:37:30 UTC (rev 116)
@@ -0,0 +1,44 @@
+\name{tawnT2Copula}
+\alias{tawnT2Copula}
+\alias{surTawnT2Copula}
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/spcopula -r 116


More information about the spcopula-commits mailing list