[spcopula-commits] r121 - in pkg: . R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Feb 7 16:21:35 CET 2014
Author: ben_graeler
Date: 2014-02-07 16:21:34 +0100 (Fri, 07 Feb 2014)
New Revision: 121
Added:
pkg/inst/
pkg/inst/CITATION
Removed:
pkg/R/BB1copula.R
pkg/R/BB6copula.R
pkg/R/BB7copula.R
pkg/R/BB8copula.R
pkg/R/ClaytonGumbelCopula.R
pkg/R/joeBiCopula.R
pkg/R/linkingVineCopula.R
pkg/R/tawnCopula.R
pkg/R/vineCopulas.R
pkg/R/wrappingCFunctions.R
pkg/man/BB1Copula-class.Rd
pkg/man/BB1Copula.Rd
pkg/man/BB6Copula-class.Rd
pkg/man/BB6Copula.Rd
pkg/man/BB7Copula-class.Rd
pkg/man/BB7Copula.Rd
pkg/man/BB8Copula-class.Rd
pkg/man/BB8Copula.Rd
pkg/man/copulaFromFamilyIndex.Rd
pkg/man/joeBiCopula-class.Rd
pkg/man/joeBiCopula.Rd
pkg/man/surClaytonCopula-class.Rd
pkg/man/surClaytonCopula.Rd
pkg/man/surGumbelCopula-class.Rd
pkg/man/surGumbelCopula.Rd
pkg/man/tawnT1Copula-class.Rd
pkg/man/tawnT1Copula.Rd
pkg/man/tawnT2Copula-class.Rd
pkg/man/tawnT2Copula.Rd
pkg/man/vineCopula-class.Rd
pkg/man/vineCopula.Rd
Modified:
pkg/DESCRIPTION
pkg/NAMESPACE
pkg/R/Classes.R
pkg/R/asCopula.R
pkg/R/cqsCopula.R
pkg/R/empiricalCopula.R
pkg/R/partialDerivatives.R
pkg/R/returnPeriods.R
pkg/R/spatialPreparation.R
pkg/R/tawn3pCopula.R
pkg/man/calcBins.Rd
pkg/man/getKendallDistr.Rd
pkg/man/kendallDistribution.Rd
Log:
- version 0.2-0 starts here (all VineCopula wrapper classes have been moved to VineCopula, this required some re-ordering of functions across files (i.e. related to Kendall))
- CITATION file added
- VineCopula:::fasttau is replaced by the exported function TauMatrix
- fitCopula method for tawn3pCopula corrected with useful default values
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2014-02-03 09:05:48 UTC (rev 120)
+++ pkg/DESCRIPTION 2014-02-07 15:21:34 UTC (rev 121)
@@ -1,17 +1,17 @@
Package: spcopula
Type: Package
Title: copula driven spatial analysis
-Version: 0.1-1
-Date: 2013-11-20
-Authors at R: c(person("Benedikt", "Graeler", role = c("aut", "cre"), email =
- "ben.graeler at uni-muenster.de"), person("Marius", "Appel",
- role = "ctb"))
+Version: 0.2-0
+Date: 2014-02-07
+Authors at R: c(person("Benedikt", "Graeler", role = c("aut", "cre"),
+ email = "ben.graeler at uni-muenster.de"),
+ person("Marius", "Appel",role = "ctb"))
Maintainer: Benedikt Graeler <ben.graeler at uni-muenster.de>
Description: This package provides a framework to analyse via copulas spatial and spatio-temporal data provided in the format of sp and spacetime package respectively. Additionally, support for calculating different multivariate return periods is implemented.
License: GPL-2
LazyLoad: yes
-Depends: copula (>= 0.999-7), R (>= 2.15.0)
-Imports: VineCopula (>= 1.1-2), sp, spacetime (>= 1.0-9), methods
+Depends: copula (>= 0.999-7), VineCopula (>= 1.2-1), R (>= 2.15.0)
+Imports: sp, spacetime (>= 1.0-9), methods
URL: http://r-forge.r-project.org/projects/spcopula/
Collate:
Classes.R
@@ -24,21 +24,11 @@
stCopula.R
spatialPreparation.R
spatio-temporalPreparation.R
- wrappingCFunctions.R
- linkingVineCopula.R
- BB1copula.R
- BB6copula.R
- BB7copula.R
- BB8copula.R
- joeBiCopula.R
- ClaytonGumbelCopula.R
- vineCopulas.R
spVineCopula.R
stVineCopula.R
utilities.R
returnPeriods.R
spatialGaussianCopula.R
- tawnCopula.R
tawn3pCopula.R
tailDependenceFunctions.R
zzz.R
Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE 2014-02-03 09:05:48 UTC (rev 120)
+++ pkg/NAMESPACE 2014-02-07 15:21:34 UTC (rev 121)
@@ -4,23 +4,14 @@
# constructor
export(asCopula, cqsCopula)
-export(BB1Copula, surBB1Copula, r90BB1Copula, r270BB1Copula)
-export(BB6Copula, surBB6Copula, r90BB6Copula, r270BB6Copula)
-export(BB7Copula, surBB7Copula, r90BB7Copula, r270BB7Copula)
-export(BB8Copula, surBB8Copula, r90BB8Copula, r270BB8Copula)
-export(joeBiCopula, surJoeBiCopula, r90JoeBiCopula, r270JoeBiCopula)
-export(surClaytonCopula, r90ClaytonCopula, r270ClaytonCopula)
-export(surGumbelCopula, r90GumbelCopula, r270GumbelCopula)
-export(tawnT1Copula, surTawnT1Copula, r90TawnT1Copula, r270TawnT1Copula)
-export(tawnT2Copula, surTawnT2Copula, r90TawnT2Copula, r270TawnT2Copula)
export(tawn3pCopula)
export(spCopula, stCopula)
-export(vineCopula, spVineCopula, stVineCopula)
+export(spVineCopula, stVineCopula)
export(neighbourhood, stNeighbourhood)
export(empiricalCopula, genEmpCop)
# general functions
-export(rankTransform, dependencePlot, unitScatter, univScatter, copulaFromFamilyIndex)
+export(rankTransform, dependencePlot, unitScatter, univScatter)
export(fitCopula)
export(dduCopula,ddvCopula)
export(invdduCopula, invddvCopula)
@@ -48,14 +39,5 @@
export(criticalPair, criticalTriple)
## classes
-exportClasses(asCopula, cqsCopula, neighbourhood, stNeighbourhood, empiricalCopula)
-exportClasses(spCopula, stCopula, vineCopula, spVineCopula, stVineCopula)
-
-# wrappers to CDVine
-exportClasses(BB1Copula, surBB1Copula, r90BB1Copula, r270BB1Copula)
-exportClasses(BB6Copula, surBB6Copula, r90BB6Copula, r270BB6Copula)
-exportClasses(BB7Copula, surBB7Copula, r90BB7Copula, r270BB7Copula)
-exportClasses(BB8Copula, surBB8Copula, r90BB8Copula, r270BB8Copula)
-exportClasses(joeBiCopula, surJoeBiCopula, r90JoeBiCopula, r270JoeBiCopula)
-exportClasses(surClaytonCopula, r90ClaytonCopula, r270ClaytonCopula)
-exportClasses(surGumbelCopula, r90GumbelCopula, r270GumbelCopula)
\ No newline at end of file
+exportClasses(asCopula, cqsCopula, tawn3pCopula, neighbourhood, stNeighbourhood, empiricalCopula)
+exportClasses(spCopula, stCopula, spVineCopula, stVineCopula)
\ No newline at end of file
Deleted: pkg/R/BB1copula.R
===================================================================
--- pkg/R/BB1copula.R 2014-02-03 09:05:48 UTC (rev 120)
+++ pkg/R/BB1copula.R 2014-02-07 15:21:34 UTC (rev 121)
@@ -1,261 +0,0 @@
-#####################
-## ##
-## the BB1 copulas ##
-## ##
-#####################
-# Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
-
-validBB1Copula = function(object) {
- if (object at dimension != 2)
- return("Only BB1 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("BB1Copula",
- representation = representation("copula", family="numeric"),
- validity = validBB1Copula,
- contains = list("copula")
-)
-
-# constructor
-BB1Copula <- function (param=c(1,1)) {
- if (any(is.na(param) | param >= c(Inf,Inf) | param[1] <= 0 | param[2] < 1))
- stop(paste("Parameter values out of bounds: theta: (0,Inf), delta: [1,Inf)."))
- new("BB1Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(0, 1), param.upbnd = c(Inf, Inf),
- family=7, fullname = "BB1 copula family. Number 7 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","BB1Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","BB1Copula"),
- function(u, copula, log) linkVineCop.PDF(u, copula, log))
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","BB1Copula"), linkVineCop.CDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","BB1Copula"), linkVineCop.ddu)
-
-# ddv
-setMethod("ddvCopula", signature("numeric","BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","BB1Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","BB1Copula"), linkVineCop.r)
-
-## kendall distribution/measure
-kendall.BB1 <- function(copula, t){
- theta = copula at parameters[1]
- delta = copula at parameters[2]
-
- kt <- rep(NA,length(t))
- kt <- t + 1/(theta * delta) * (t^(-theta) - 1)/(t^(-1 - theta))
- kt[t==1] <- 1
- kt[t==0] <- 0
- return(kt)
-}
-
-setMethod("kendallDistribution", signature("BB1Copula"), kendall.BB1)
-
-setMethod("getKendallDistr", signature("BB1Copula"), function(copula) return(function(t) kendall.BB1(copula, t)) )
-
-setMethod("tau",signature("BB1Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("BB1Copula"),linkVineCop.tailIndex)
-
-#########################
-## BB1 survival copula ##
-#########################
-
-setClass("surBB1Copula",
- representation = representation("copula", family="numeric"),
- validity = validBB1Copula,
- contains = list("copula")
-)
-
-# constructor
-surBB1Copula <- function (param=c(1,1)) {
- if (any(is.na(param) | param >= c(Inf,Inf) | param[1] <= 0 | param[2] < 1))
- stop(paste("Parameter values out of bounds: theta: (0,Inf), delta: [1,Inf)."))
- new("surBB1Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(0, 1), param.upbnd = c(Inf, Inf),
- family=17, fullname = "Survival BB1 copula family. Number 17 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","surBB1Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","surBB1Copula"), linkVineCop.PDF)
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","surBB1Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","surBB1Copula"), linkVineCop.surCDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","surBB1Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","surBB1Copula"), linkVineCop.ddu)
-
-# ddv
-setMethod("ddvCopula", signature("numeric","surBB1Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","surBB1Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","surBB1Copula"), linkVineCop.r)
-
-setMethod("tau",signature("surBB1Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("surBB1Copula"),linkVineCop.tailIndex)
-
-#######################
-## BB1 copula 90 deg ##
-#######################
-
-validRotBB1Copula = function(object) {
- if (object at dimension != 2)
- return("Only BB1 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("r90BB1Copula",
- representation = representation("copula", family="numeric"),
- validity = validRotBB1Copula,
- contains = list("copula")
-)
-
-# constructor
-r90BB1Copula <- function (param=c(-1,-1)) {
- if (any(is.na(param) | param[1] >= 0 | param[2] > -1 | param <= c(-Inf,-Inf)))
- stop(paste("Parameter values out of bounds: theta: (-Inf,0), delta: (-Inf,-1]."))
- new("r90BB1Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(0, -1),
- family=27, fullname = "90 deg rotated BB1 copula family. Number 27 in VineCopula.")
-}
-BiCopCDF
-## density ##
-setMethod("dCopula", signature("numeric","r90BB1Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","r90BB1Copula"), linkVineCop.PDF)
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","r90BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","r90BB1Copula"), linkVineCop.r90CDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","r90BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","r90BB1Copula"), linkVineCop.ddu)
-
-## ddv
-setMethod("ddvCopula", signature("numeric","r90BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","r90BB1Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","r90BB1Copula"), linkVineCop.r)
-
-setMethod("tau",signature("r90BB1Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("r90BB1Copula"),linkVineCop.tailIndex)
-
-########################
-## BB1 copula 270 deg ##
-########################
-
-setClass("r270BB1Copula",
- representation = representation("copula", family="numeric"),
- validity = validRotBB1Copula,
- contains = list("copula")
-)
-
-# constructor
-r270BB1Copula <- function (param=c(-1,-1)) {
- if (any(is.na(param) | param[1] >= 0 | param[2] > -1 | param <= c(-Inf,-Inf)))
- stop(paste("Parameter values out of bounds: theta: (-Inf,0), delta: (-Inf,-1]."))
- new("r270BB1Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(0, -1),
- family=37, fullname = "270 deg rotated BB1 copula family. Number 37 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","r270BB1Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","r270BB1Copula"), linkVineCop.PDF)
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","r270BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","r270BB1Copula"), linkVineCop.r270CDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","r270BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","r270BB1Copula"), linkVineCop.ddu)
-
-# ddv
-setMethod("ddvCopula", signature("numeric","r270BB1Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","r270BB1Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","r270BB1Copula"), linkVineCop.r)
-
-setMethod("tau",signature("r270BB1Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("r270BB1Copula"),linkVineCop.tailIndex)
\ No newline at end of file
Deleted: pkg/R/BB6copula.R
===================================================================
--- pkg/R/BB6copula.R 2014-02-03 09:05:48 UTC (rev 120)
+++ pkg/R/BB6copula.R 2014-02-07 15:21:34 UTC (rev 121)
@@ -1,263 +0,0 @@
-#####################
-## ##
-## the BB6 copulas ##
-## ##
-#####################
-# Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
-
-validBB6Copula = function(object) {
- if (object at dimension != 2)
- return("Only BB6 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")
- if (any(is.na(param) | param >= upper | param < lower))
- return("Parameter value out of bound.")
- else return (TRUE)
-}
-
-setClass("BB6Copula",
- representation = representation("copula", family="numeric"),
- validity = validBB6Copula,
- contains = list("copula")
-)
-
-# constructor
-BB6Copula <- function (param=c(1,1)) {
- if (any(is.na(param) | param >= c(Inf, Inf) | param < c(1,1)))
- stop("Parameter value(s) out of bound(s): theta: [1,Inf), delta: [1,Inf).")
- new("BB6Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(1, 1), param.upbnd = c(Inf, Inf),
- family=8, fullname = "BB6 copula family. Number 8 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","BB6Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","BB6Copula"), function(u, copula, log) linkVineCop.PDF(u, copula, log))
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","BB6Copula"), linkVineCop.CDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","BB6Copula"), linkVineCop.ddu)
-
-# ddv
-setMethod("ddvCopula", signature("numeric","BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","BB6Copula"), linkVineCop.ddv)
-
-## random number generater ??
-setMethod("rCopula", signature("numeric","BB6Copula"), linkVineCop.r)
-
-## kendall distribution/measure, taken from VineCopula:::obs.stat
-kendall.BB6 <- function(copula, t){
- theta = copula at parameters[1]
- delta = copula at parameters[2]
-
- kt <- rep(NA,length(t))
- kt <- t + log(-(1 - t)^theta + 1) * (1 - t - (1 - t)^(-theta) + (1 - t)^(-theta) * t)/(delta * theta)
- kt[t==1] <- 1
- kt[t==0] <- 0
- return(kt)
-}
-
-setMethod("kendallDistribution", signature("BB6Copula"), kendall.BB6)
-
-setMethod("getKendallDistr", signature("BB6Copula"),
- function(copula) return(function(t) kendall.BB6(copula, t)))
-
-setMethod("tau",signature("BB6Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("BB6Copula"),linkVineCop.tailIndex)
-
-#########################
-## BB6 survival copula ##
-#########################
-
-setClass("surBB6Copula",
- representation = representation("copula", family="numeric"),
- validity = validBB6Copula,
- contains = list("copula")
-)
-
-# constructor
-surBB6Copula <- function (param=c(1,1)) {
- if (any(is.na(param) | param >= c(Inf, Inf) | param < c(1,1)))
- stop("Parameter value(s) out of bound(s): theta: [1,Inf), delta: [1,Inf).")
- new("surBB6Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(1, 1), param.upbnd = c(Inf, Inf),
- family=18, fullname = "Survival BB6 copula family. Number 18 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","surBB6Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","surBB6Copula"), linkVineCop.PDF)
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","surBB6Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","surBB6Copula"), linkVineCop.surCDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","surBB6Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","surBB6Copula"), linkVineCop.ddu)
-
-# ddv
-setMethod("ddvCopula", signature("numeric","surBB6Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","surBB6Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","surBB6Copula"), linkVineCop.r)
-
-setMethod("tau",signature("surBB6Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("surBB6Copula"),linkVineCop.tailIndex)
-
-#######################
-## BB6 copula 90 deg ##
-#######################
-
-validRotBB6Copula = function(object) {
- if (object at dimension != 2)
- return("Only BB6 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("r90BB6Copula",
- representation = representation("copula", family="numeric"),
- validity = validRotBB6Copula,
- contains = list("copula")
-)
-
-# constructor
-r90BB6Copula <- function (param=c(-1,-1)) {
- if (any(is.na(param) | param > c(-1,-1) | param <= c(-Inf,-Inf)))
- stop("Parameter value out of bound: theta: (-Inf,1], delta: (-Inf,1].")
- new("r90BB6Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(-1, -1),
- family=28, fullname = "90 deg rotated BB6 copula family. Number 28 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","r90BB6Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula,log)
- })
-setMethod("dCopula", signature("matrix","r90BB6Copula"), linkVineCop.PDF)
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","r90BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","r90BB6Copula"), linkVineCop.r90CDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","r90BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","r90BB6Copula"), linkVineCop.ddu)
-
-## ddv
-setMethod("ddvCopula", signature("numeric","r90BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","r90BB6Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","r90BB6Copula"), linkVineCop.r)
-
-setMethod("tau",signature("r90BB6Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("r90BB6Copula"),linkVineCop.tailIndex)
-
-###########################
-## BB6 copula 270 degree ##
-###########################
-
-setClass("r270BB6Copula",
- representation = representation("copula", family="numeric"),
- validity = validRotBB6Copula,
- contains = list("copula")
-)
-
-# constructor
-r270BB6Copula <- function (param=c(-1,-1)) {
- if (any(is.na(param) | param > c(-1,-1) | param <= c(-Inf,-Inf)))
- stop("Parameter value out of bound: theta: (-Inf,1], delta: (-Inf,1].")
- new("r270BB6Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(-1, -1),
- family=38, fullname = "270 deg rotated BB6 copula family. Number 38 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","r270BB6Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension, log),copula)
- })
-setMethod("dCopula", signature("matrix","r270BB6Copula"), linkVineCop.PDF)
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","r270BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","r270BB6Copula"), linkVineCop.r270CDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","r270BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","r270BB6Copula"), linkVineCop.ddu)
-
-# ddv
-setMethod("ddvCopula", signature("numeric","r270BB6Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","r270BB6Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","r270BB6Copula"), linkVineCop.r)
-
-setMethod("tau",signature("r270BB6Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("r270BB6Copula"),linkVineCop.tailIndex)
\ No newline at end of file
Deleted: pkg/R/BB7copula.R
===================================================================
--- pkg/R/BB7copula.R 2014-02-03 09:05:48 UTC (rev 120)
+++ pkg/R/BB7copula.R 2014-02-07 15:21:34 UTC (rev 121)
@@ -1,265 +0,0 @@
-#####################
-## ##
-## the BB7 copulas ##
-## ##
-#####################
-# Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
-
-validBB7Copula = function(object) {
- if (object at dimension != 2)
- return("Only BB7 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("BB7Copula",
- representation = representation("copula", family="numeric"),
- validity = validBB7Copula,
- contains = list("copula")
-)
-
-# constructor
-BB7Copula <- function (param=c(1,1)) {
- if (any(is.na(param) | param >= c(Inf, Inf) | param[1] < 1 | param[2] <= 0))
- stop(paste("Parameter values out of bounds: theta: [1,Inf), delta: (0,Inf)."))
- new("BB7Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(1, 0), param.upbnd = c(Inf, Inf),
- family=9, fullname = "BB7 copula family. Number 9 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","BB7Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","BB7Copula"), function(u, copula, log) linkVineCop.PDF(u, copula, log))
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","BB7Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","BB7Copula"), linkVineCop.CDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","BB7Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","BB7Copula"), linkVineCop.ddu)
-
-# ddv
-setMethod("ddvCopula", signature("numeric","BB7Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","BB7Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","BB7Copula"), linkVineCop.r)
-
-## kendall distribution/measure, taken from VineCopula:::obs.stat
-kendall.BB7 <- function(copula, t){
- theta = copula at parameters[1]
- delta = copula at parameters[2]
-
- kt <- rep(NA,length(t))
- kt <- t + 1/(theta * delta) * ((1 - (1 - t)^theta)^(-delta) - 1)/
- ((1 - t)^(theta - 1) * (1 - (1 - t)^theta)^(-delta - 1))
- kt[t==1] <- 1
- kt[t==0] <- 0
- return(kt)
-}
-
-setMethod("kendallDistribution", signature("BB7Copula"), kendall.BB7)
-
-setMethod("getKendallDistr", signature("BB7Copula"),
- function(copula) return(function(t) kendall.BB7(copula, t)))
-
-setMethod("tau",signature("BB7Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("BB7Copula"),linkVineCop.tailIndex)
-
-
-#########################
-## BB7 survival copula ##
-#########################
-
-setClass("surBB7Copula",
- representation = representation("copula", family="numeric"),
- validity = validBB7Copula,
- contains = list("copula")
-)
-
-# constructor
-surBB7Copula <- function (param=c(1,1)) {
- if (any(is.na(param) | param >= c(Inf, Inf) | param[1] < 1 | param[2] <= 0))
- stop(paste("Parameter values out of bounds: theta: [1,Inf), delta: (0,Inf)."))
- new("surBB7Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(1, 0), param.upbnd = c(Inf, Inf),
- family= 19, fullname = "Survival BB7 copula family. Number 19 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","surBB7Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension,),copula,log=log)
- })
-setMethod("dCopula", signature("matrix","surBB7Copula"), linkVineCop.PDF)
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","surBB7Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","surBB7Copula"), linkVineCop.surCDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","surBB7Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","surBB7Copula"), linkVineCop.ddu)
-
-# ddv
-setMethod("ddvCopula", signature("numeric","surBB7Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","surBB7Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","surBB7Copula"), linkVineCop.r)
-
-setMethod("tau",signature("surBB7Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("surBB7Copula"),linkVineCop.tailIndex)
-
-###################
-## BB7 copula 90 ##
-###################
-
-validRotBB7Copula = function(object) {
- if (object at dimension != 2)
- return("Only BB7 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")
- if (any(is.na(param) | param[1] > upper[1] | param[2] >= upper[2] | param <= lower))
- return("Parameter value out of bound")
- else return (TRUE)
-}
-
-setClass("r90BB7Copula",
- representation = representation("copula", family="numeric"),
- validity = validRotBB7Copula,
- contains = list("copula")
-)
-
-# constructor
-r90BB7Copula <- function (param=c(-1,-1)) {
- if (any(is.na(param) | param[1] > -1 | param[2] >= 0 | param <= c(-Inf,-Inf)))
- stop(paste("Parameter values out of bounds: theta: (-Inf,-1], delta: (-Inf,0)."))
- new("r90BB7Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(-1, 0),
- family=29, fullname = "90 deg rotated BB7 copula family. Number 29 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","r90BB7Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","r90BB7Copula"), linkVineCop.PDF)
-
-## jcdf ##
-setMethod("pCopula", signature("numeric","r90BB7Copula"),
- function(u, copula, ...) {
- linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("pCopula", signature("matrix","r90BB7Copula"), linkVineCop.r90CDF)
-
-## partial derivatives ##
-# ddu
-setMethod("dduCopula", signature("numeric","r90BB7Copula"),
- function(u, copula, ...) {
- linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("dduCopula", signature("matrix","r90BB7Copula"), linkVineCop.ddu)
-
-## ddv
-setMethod("ddvCopula", signature("numeric","r90BB7Copula"),
- function(u, copula, ...) {
- linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula)
- })
-setMethod("ddvCopula", signature("matrix","r90BB7Copula"), linkVineCop.ddv)
-
-## random number generator
-setMethod("rCopula", signature("numeric","r90BB7Copula"), linkVineCop.r)
-
-setMethod("tau",signature("r90BB7Copula"),linkVineCop.tau)
-setMethod("tailIndex",signature("r90BB7Copula"),linkVineCop.tailIndex)
-
-########################
-## BB7 copula 270 deg ##
-########################
-
-setClass("r270BB7Copula",
- representation = representation("copula", family="numeric"),
- validity = validRotBB7Copula,
- contains = list("copula")
-)
-
-# constructor
-r270BB7Copula <- function (param=c(-1,-1)) {
- if (any(is.na(param) | param[1] > -1 | param[2] >= 0 | param <= c(-Inf,-Inf)))
- stop(paste("Parameter values out of bounds: theta: (-Inf,-1], delta: (-Inf,0)."))
- new("r270BB7Copula", dimension = as.integer(2), parameters = param,
- param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(-1, 0),
- family=39, fullname = "270 deg rotated BB7 copula family. Number 39 in VineCopula.")
-}
-
-## density ##
-setMethod("dCopula", signature("numeric","r270BB7Copula"),
- function(u, copula, log) {
- linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log)
- })
-setMethod("dCopula", signature("matrix","r270BB7Copula"), linkVineCop.PDF)
-
-## jcdf ##
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/spcopula -r 121
More information about the spcopula-commits
mailing list