tnagler / VC2copula

@@ -135,3 +135,8 @@
Loading
135 135
  bc <- copula2BiCop(copula)
136 136
  unlist(VineCopula::BiCopPar2TailDep(bc$family, bc$par, bc$par2))
137 137
}
138 +
139 +
# metods in copula
140 +
141 +
# iTau
142 +
BCiTau <- function(copula, tau) VineCopula::BiCopTau2Par(copula@family, tau)

@@ -33,6 +33,8 @@
Loading
33 33
#'
34 34
#' showClass("tawnT1Copula")
35 35
NULL
36 +
37 +
#' @exportClass tawnT1Copula surTawnT1Copula r90TawnT1Copula r270TawnT1Copula
36 38
generateClass("tawnT1Copula")
37 39
generateClass("surTawnT1Copula")
38 40
generateClass("r90TawnT1Copula")
@@ -118,3 +120,26 @@
Loading
118 120
    fullname = "270 deg rotated Tawn type 1 copula family. Number 134 in VineCopula."
119 121
  )
120 122
}
123 +
124 +
# Pickand's A
125 +
# c-code: Tawn1(double* t, int* n, double* par, double* par2, double* par3, double* out)
126 +
setMethod("A", signature("tawnT1Copula"), function(copula, w) {
127 +
  .C("Tawn2", as.double(w), as.integer(length(w)),
128 +
     as.double(copula@parameters[1]), as.double(copula@parameters[2]),
129 +
     as.double(1), as.double(rep(0, length(w))),
130 +
     PACKAGE = "VineCopula"
131 +
  )[[6]]
132 +
})
133 +
134 +
# c-code: Tawn1(double* t, int* n, double* par, double* par2, double* par3, double* out)
135 +
setMethod("A", signature("surTawnT1Copula"), function(copula, w) {
136 +
  u <- -expm1(-1 + w)
137 +
  v <- -expm1(-w)
138 +
139 +
  surA <- .C("Tawn2", as.double(log(v) / log(u * v)), as.integer(length(w)),
140 +
             as.double(copula@parameters[1]), as.double(copula@parameters[2]),
141 +
             as.double(1), as.double(rep(0, length(w))),
142 +
             PACKAGE = "VineCopula"
143 +
  )[[6]]
144 +
  -log(1 - u + 1 - v - 1 + (u * v)^surA)
145 +
})

@@ -33,6 +33,8 @@
Loading
33 33
#'
34 34
#' showClass("tawnT2Copula")
35 35
NULL
36 +
37 +
#' @exportClass tawnT2Copula surTawnT2Copula r90TawnT2Copula r270TawnT2Copula
36 38
generateClass("tawnT2Copula")
37 39
generateClass("surTawnT2Copula")
38 40
generateClass("r90TawnT2Copula")

@@ -41,6 +41,8 @@
Loading
41 41
#'
42 42
#' showClass("surJoeBiCopula")
43 43
NULL
44 +
45 +
#' @exportClass joeBiCopula surJoeBiCopula r90JoeBiCopula r270JoeBiCopula
44 46
generateClass("joeBiCopula")
45 47
generateClass("surJoeBiCopula")
46 48
generateClass("r90JoeBiCopula")
@@ -128,3 +130,8 @@
Loading
128 130
    fullname = "270 deg rotated Joe copula family. Number 36 in VineCopula."
129 131
  )
130 132
}
133 +
134 +
setMethod("iTau", signature = c("joeBiCopula", "ANY"), BCiTau)
135 +
setMethod("iTau", signature = c("r90JoeBiCopula", "ANY"), BCiTau)
136 +
setMethod("iTau", signature = c("surJoeBiCopula", "ANY"), BCiTau)
137 +
setMethod("iTau", signature = c("r270JoeBiCopula", "ANY"), BCiTau)

@@ -33,6 +33,8 @@
Loading
33 33
#' persp(r90ClaytonCopula(-.5), dCopula, zlim = c(0, 10))
34 34
#' persp(r270ClaytonCopula(-.5), dCopula, zlim = c(0, 10))
35 35
NULL
36 +
37 +
#' @exportClass surClaytonCopula r90ClaytonCopula r270ClaytonCopula
36 38
generateClass("surClaytonCopula")
37 39
generateClass("r90ClaytonCopula")
38 40
generateClass("r270ClaytonCopula")
@@ -95,3 +97,8 @@
Loading
95 97
    fullname = "270 deg rotated Clayton copula family. Number 33 in VineCopula."
96 98
  )
97 99
}
100 +
101 +
# iTau
102 +
setMethod("iTau", signature = c("r90ClaytonCopula", "ANY"), BCiTau)
103 +
setMethod("iTau", signature = c("surClaytonCopula", "ANY"), BCiTau)
104 +
setMethod("iTau", signature = c("r270ClaytonCopula", "ANY"), BCiTau)

@@ -32,6 +32,8 @@
Loading
32 32
#'
33 33
#' showClass("BB8Copula")
34 34
NULL
35 +
36 +
#' @exportClass BB8Copula surBB8Copula r90BB8Copula r270BB8Copula
35 37
generateClass("BB8Copula")
36 38
generateClass("surBB8Copula")
37 39
generateClass("r90BB8Copula")

@@ -32,6 +32,8 @@
Loading
32 32
#'
33 33
#' showClass("BB7Copula")
34 34
NULL
35 +
36 +
#' @exportClass BB7Copula surBB7Copula r90BB7Copula r270BB7Copula
35 37
generateClass("BB7Copula")
36 38
generateClass("surBB7Copula")
37 39
generateClass("r90BB7Copula")

@@ -32,6 +32,8 @@
Loading
32 32
#'
33 33
#' showClass("BB6Copula")
34 34
NULL
35 +
36 +
#' @exportClass BB6Copula surBB6Copula r90BB6Copula r270BB6Copula
35 37
generateClass("BB6Copula")
36 38
generateClass("surBB6Copula")
37 39
generateClass("r90BB6Copula")

@@ -34,6 +34,8 @@
Loading
34 34
#' persp(r90GumbelCopula(-5), dCopula, zlim = c(0, 10))
35 35
#' persp(r270GumbelCopula(-5), dCopula, zlim = c(0, 10))
36 36
NULL
37 +
38 +
#' @exportClass surGumbelCopula r90GumbelCopula r270GumbelCopula
37 39
generateClass("surGumbelCopula")
38 40
generateClass("r90GumbelCopula")
39 41
generateClass("r270GumbelCopula")
@@ -96,3 +98,9 @@
Loading
96 98
      fullname = "270 deg rotated Gumbel copula family. Number 34 in VineCopula."
97 99
  )
98 100
}
101 +
102 +
# iTau
103 +
setMethod("iTau", signature = c("r90GumbelCopula", "ANY"), BCiTau)
104 +
setMethod("iTau", signature = c("surGumbelCopula", "ANY"), BCiTau)
105 +
setMethod("iTau", signature = c("r270GumbelCopula", "ANY"), BCiTau)
106 +
Files Coverage
R 94.51%
Project Totals (11 files) 94.51%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading