Title: | Extend the 'copula' Package with Families and Models from 'VineCopula' |
Version: | 0.1.5 |
Description: | Provides new classes for (rotated) BB1, BB6, BB7, BB8, and Tawn copulas, extends the existing Gumbel and Clayton families with rotations, and allows to set up a vine copula model using the 'copula' API. Corresponding objects from the 'VineCopula' API can easily be converted. |
License: | GPL-3 |
Encoding: | UTF-8 |
URL: | https://github.com/tnagler/VC2copula |
BugReports: | https://github.com/tnagler/VC2copula/issues |
Depends: | copula (≥ 1.1-2) |
Imports: | VineCopula (≥ 2.3.0), methods |
LinkingTo: | VineCopula |
Suggests: | lattice, testthat (≥ 2.1.0) |
RoxygenNote: | 7.2.3 |
Language: | en-US |
NeedsCompilation: | yes |
Packaged: | 2024-02-22 13:43:32 UTC; n5 |
Author: | Thomas Nagler [aut, cre], Benedikt Graeler [ctb] |
Maintainer: | Thomas Nagler <mail@tnagler.com> |
Repository: | CRAN |
Date/Publication: | 2024-02-22 14:00:02 UTC |
VC2copula: Extend the 'copula' Package with Families and Models from 'VineCopula'
Description
Provides new classes for (rotated) BB1, BB6, BB7, BB8, and Tawn copulas, extends the existing Gumbel and Clayton families with rotations, and allows to set up a vine copula model using the 'copula' API. Corresponding objects from the 'VineCopula' API can easily be converted.
Provides new classes for (rotated) BB1, BB6, BB7, BB8, and Tawn copulas, extends the existing Gumbel and Clayton families with rotations, and allows to set up a vine copula model using the 'copula' API. Corresponding objects from the 'VineCopula' API can easily be converted.
Author(s)
Maintainer: Thomas Nagler mail@tnagler.com
Other contributors:
Benedikt Graeler [contributor]
See Also
Useful links:
Useful links:
Constructors for BB1 copulas
Description
Constructs an object of the BB1Copula (survival
sur
, 90 degree rotated r90
and 270 degree rotated r270
)
family for given parameters.
Usage
BB1Copula(param = c(1, 1))
surBB1Copula(param = c(1, 1))
r90BB1Copula(param = c(-1, -1))
r270BB1Copula(param = c(-1, -1))
Arguments
param |
The parameter |
Value
One of the respective BB1 copula classes (BB1Copula, surBB1Copula, r90BB1Copula, r270BB1Copula).
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB6Copula()
, BB7Copula()
,
BB8Copula()
and joeCopula()
for further wrapper
functions to the VineCopula-package()
.
Examples
library(copula)
persp(BB1Copula(c(1, 1.5)), dCopula, zlim = c(0, 10))
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))
BB1 copula models
Description
Wrapper classes representing the BB1, survival BB1, 90 degree and 270 degree
rotated BB1 copula families (Joe 1997) from VineCopula-package()
.
Objects from the Classes
Objects can be created by calls of the
form new("BB1Copula", ...)
, new("surBB1Copula", ...)
,
new("r90BB1Copula", ...)
and new("r270BB1Copula", ...)
or by the
functions BB1Copula()
, surBB1Copula()
, r90BB1Copula()
and
r270BB1Copula()
.
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB6Copula, BB7Copula, BB8Copula and
joeCopula for further wrapper classes to the
VineCopula-package()
.
Examples
showClass("BB1Copula")
Constructors for BB6 copulas
Description
Constructs an object of the BB6Copula (survival sur
, 90 degree
rotated r90
and 270 degree rotated r270
) family for given parameters.
Usage
BB6Copula(param = c(1, 1))
surBB6Copula(param = c(1, 1))
r90BB6Copula(param = c(-1, -1))
r270BB6Copula(param = c(-1, -1))
Arguments
param |
The parameter |
Value
One of the respective BB6 copula classes (BB6Copula, surBB6Copula, r90BB6Copula, r270BB6Copula).
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB6Copula()
, BB7Copula()
, BB8Copula()
and
joeCopula()
for further wrapper functions to the VineCopula-package()
.
Examples
library(copula)
persp(BB6Copula(c(1, 1.5)), dCopula, zlim = c(0, 10))
persp(surBB6Copula(c(1, 1.5)), dCopula, zlim = c(0, 10))
persp(r90BB6Copula(c(-1, -1.5)), dCopula, zlim = c(0, 10))
persp(r270BB6Copula(c(-1, -1.5)), dCopula, zlim = c(0, 10))
BB6 copula models
Description
Wrapper classes representing the BB6, survival BB6, 90 degree and 270 degree
rotated BB6 copula families (Joe 1997) from VineCopula-package()
.
Objects from the Classes
Objects can be created by calls of the
form new("BB6Copula", ...)
, new("surBB6Copula", ...)
,
new("r90BB6Copula", ...)
and new("r270BB6Copula", ...)
or by the
functions BB6Copula()
, surBB6Copula()
, r90BB6Copula()
and
r270BB6Copula()
.
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB6Copula, BB7Copula, BB8Copula and
joeCopula for further wrapper classes to the
VineCopula-package()
.
Examples
showClass("BB6Copula")
Constructors for BB7 copulas
Description
Constructs an object of the BB7Copula (survival
sur
, 90 degree rotated r90
and 270 degree rotated r270
)
family for given parameters.
Usage
BB7Copula(param = c(1, 1))
surBB7Copula(param = c(1, 1))
r90BB7Copula(param = c(-1, -1))
r270BB7Copula(param = c(-1, -1))
Arguments
param |
The parameter |
Value
One of the respective BB7 copula classes (BB7Copula, surBB7Copula, r90BB7Copula, r270BB7Copula).
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB6Copula()
, BB7Copula()
,
BB8Copula()
and joeCopula()
for further wrapper
functions to the VineCopula-package()
.
Examples
library(copula)
persp(BB7Copula(c(1, 1.5)), dCopula, zlim = c(0, 10))
persp(surBB7Copula(c(1, 1.5)), dCopula, zlim = c(0, 10))
persp(r90BB7Copula(c(-1, -1.5)), dCopula, zlim = c(0, 10))
persp(r270BB7Copula(c(-1, -1.5)), dCopula, zlim = c(0, 10))
BB7 copula models
Description
Wrapper classes representing the BB7, survival BB7, 90 degree and 270 degree
rotated BB7 copula families (Joe 1997) from VineCopula-package()
.
Objects from the Classes
Objects can be created by calls of the
form new("BB7Copula", ...)
, new("surBB7Copula", ...)
,
new("r90BB7Copula", ...)
and new("r270BB7Copula", ...)
or by the
functions BB7Copula()
, surBB7Copula()
, r90BB7Copula()
and
r270BB7Copula()
.
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB7Copula, BB7Copula, BB8Copula and
joeCopula for further wrapper classes to the
VineCopula-package()
.
Examples
showClass("BB7Copula")
Constructors for BB8 copulas
Description
Constructs an object of the BB8Copula (survival
sur
, 90 degree rotated r90
and 270 degree rotated r270
)
family for given parameters.
Usage
BB8Copula(param = c(1, 1))
surBB8Copula(param = c(1, 1))
r90BB8Copula(param = c(-1, -1))
r270BB8Copula(param = c(-1, -1))
Arguments
param |
The parameter |
Value
One of the respective BB8 copula classes (BB8Copula, surBB8Copula, r90BB8Copula, r270BB8Copula).
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB6Copula()
, BB7Copula()
,
BB8Copula()
and joeCopula()
for further wrapper
functions to the VineCopula-package()
.
Examples
library(copula)
persp(BB8Copula(c(2, 0.9)), dCopula, zlim = c(0, 10))
persp(surBB8Copula(c(2, 0.9)), dCopula, zlim = c(0, 10))
persp(r90BB8Copula(c(-2, -0.9)), dCopula, zlim = c(0, 10))
persp(r270BB8Copula(c(-2, -0.9)), dCopula, zlim = c(0, 10))
BB8 copula models
Description
Wrapper classes representing the BB8, survival BB8, 90 degree and 270 degree
rotated BB8 copula families (Joe 1997) from VineCopula-package()
.
Objects from the Classes
Objects can be created by calls of the
form new("BB8Copula", ...)
, new("surBB8Copula", ...)
,
new("r90BB8Copula", ...)
and new("r270BB8Copula", ...)
or by the
functions BB8Copula()
, surBB8Copula()
, r90BB8Copula()
and
r270BB8Copula()
.
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB8Copula, BB8Copula, BB8Copula and
joeCopula for further wrapper classes to the
VineCopula-package()
.
Examples
showClass("BB8Copula")
Construction of a Copula Object from a VineCopula Family Index
Description
A VineCopula family index along with its parameters is used to construct a corresponding copula object.
Usage
BiCop2copula(family, par, par2 = 0, obj = NULL)
copulaFromFamilyIndex(family, par, par2 = 0)
Arguments
family |
a family index as defined in |
par |
first parameter. |
par2 |
second parameter. |
obj |
|
Details
If the family and parameter specification is stored in a [BiCop()]
object
obj
, the alternative version
BiCop2copula(u1, u2, obj)
can be used.
Value
An object inheriting copula corresponding to the specific family.
Examples
# normalCopula with parameter 0.5
BiCop2copula(1, 0.5)
# rotated Tawn T2 copula
BiCop2copula(224, -2, 0.5)
Partial Derivatives of Copulas
Description
Similar to dCopula()
and pCopula()
the function
dduCopula
evaluates the partial derivative
\frac{\partial}{\partial u} C(u,v)
and the function
ddvCopula
evaluates the partial derivative
\frac{\partial}{\partial v} C(u,v)
of the provided
copula.
Usage
dduCopula(u, copula, ...)
## S4 method for signature 'matrix,normalCopula'
dduCopula(u, copula)
## S4 method for signature 'numeric,normalCopula'
dduCopula(u, copula, ...)
## S4 method for signature 'matrix,normalCopula'
ddvCopula(u, copula)
## S4 method for signature 'numeric,normalCopula'
ddvCopula(u, copula, ...)
## S4 method for signature 'matrix,tCopula'
dduCopula(u, copula)
## S4 method for signature 'numeric,tCopula'
dduCopula(u, copula, ...)
## S4 method for signature 'matrix,tCopula'
ddvCopula(u, copula)
## S4 method for signature 'numeric,tCopula'
ddvCopula(u, copula, ...)
## S4 method for signature 'matrix,gumbelCopula'
dduCopula(u, copula)
## S4 method for signature 'numeric,gumbelCopula'
dduCopula(u, copula, ...)
## S4 method for signature 'matrix,gumbelCopula'
ddvCopula(u, copula)
## S4 method for signature 'numeric,gumbelCopula'
ddvCopula(u, copula, ...)
## S4 method for signature 'matrix,claytonCopula'
dduCopula(u, copula)
## S4 method for signature 'numeric,claytonCopula'
dduCopula(u, copula, ...)
## S4 method for signature 'matrix,claytonCopula'
ddvCopula(u, copula)
## S4 method for signature 'numeric,claytonCopula'
ddvCopula(u, copula, ...)
## S4 method for signature 'matrix,indepCopula'
dduCopula(u, copula)
## S4 method for signature 'numeric,indepCopula'
dduCopula(u, copula, ...)
## S4 method for signature 'matrix,indepCopula'
ddvCopula(u, copula)
## S4 method for signature 'numeric,indepCopula'
ddvCopula(u, copula, ...)
## S4 method for signature 'matrix,frankCopula'
dduCopula(u, copula)
## S4 method for signature 'numeric,frankCopula'
dduCopula(u, copula, ...)
## S4 method for signature 'matrix,frankCopula'
ddvCopula(u, copula)
## S4 method for signature 'numeric,frankCopula'
ddvCopula(u, copula, ...)
Arguments
u |
Pairs of values for which the partial derivative should be evaluated. |
copula |
The copula object representing the family member of interest. |
... |
additional arguments can be passed on to the underlying functions. |
Value
A vector of the evaluated partial derivatives of the same length as
rows in u
.
Examples
library(copula)
BB1Cop <- BB1Copula()
BB1CopSmpl <- rCopula(100, BB1Cop)
# conditional probabilities of a Gaussian copula given u
BB1GivenU <- dduCopula(BB1CopSmpl, BB1Cop)
# vs. conditional probabilities of a Gaussian copula given v
BB1GivenV <- ddvCopula(BB1CopSmpl[, c(2, 1)], BB1Cop)
plot(BB1GivenU, BB1GivenV)
abline(0, 1)
A dedicated method to use the estimation routines from the VineCopula package
Description
Bivariate copulas are estimated based on BiCopEst
and vine copulas through RVineStructureSelect
or RVineCopSelect
depending on the method
argument.
Usage
BCfitCopula(copula, data, method = "ml")
Arguments
copula |
an object of the desired copula class |
data |
a matrix holding the U(0,1) distributed data columns |
method |
for BIVARIATE copulas either "ml" or "itau" for maximum likelihood estimation or inverse tau estimation (for one parameter families) respectively. See |
Value
an object of class fitCopula
as in the copula package.
Examples
u <- rCopula(1000, tawnT1Copula(c(3, 0.5)))
fitCopula(tawnT1Copula(), u)
Constructors for Joe copulas
Description
Constructs an object of the (survival surJoeBiCopula
, 90 degree
rotated r90JoeBiCopula
and 270 degree rotated r270JoeBiCopula
)
family for a given parameter. Note that package copula-package()
provides a class joeCopula as well.
Usage
joeBiCopula(param = 2)
surJoeBiCopula(param = 2)
r90JoeBiCopula(param = -2)
r270JoeBiCopula(param = -2)
Arguments
param |
The parameter |
Value
One of the respective Joe copula classes (joeBiCopula, surJoeBiCopula, r90JoeBiCopula, r270JoeBiCopula).
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB1Copula()
, BB6Copula()
,
BB7Copula()
and BB8Copula()
for further wrapper
functions to the VineCopula-package()
.
Examples
library(copula)
persp(surJoeBiCopula(1.5), dCopula, zlim = c(0, 10))
persp(r90JoeBiCopula(-1.5), dCopula, zlim = c(0, 10))
persp(r270JoeBiCopula(-1.5), dCopula, zlim = c(0, 10))
Joe copula models
Description
Wrapper classes representing the bivariate Joe, survival Joe, 90 degree and
270 degree rotated Joe copula families (Joe 1997) from
VineCopula-package()
. Note that package
copula-package()
provides a class joeCopula
as well.
Objects from the Classes
Objects can be created by calls of the
form new("joeBiCopula", ...)
, new("surJoeBiCopula", ...)
,
new("r90JoeBiCopula", ...)
and new("r270JoeBiCopula", ...)
or
by the functions joeBiCopula()
, surJoeBiCopula()
,
r90JoeBiCopula()
and r270JoeBiCopula()
.
References
Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall.
See Also
See also BB1Copula,
BB6Copula, BB7Copula and
BB8Copula for further wrapper classes to the
VineCopula-package()
.
Examples
showClass("surJoeBiCopula")
Constructors for survival and rotated Clayton Copulas
Description
These are wrappers to functions from VineCopula-package()
Usage
surClaytonCopula(param = 1)
r90ClaytonCopula(param = -1)
r270ClaytonCopula(param = -1)
Arguments
param |
A single parameter defining the Copula. |
Value
An object of class surClaytonCopula, r90ClaytonCopula or r270ClaytonCopula respectively.
Examples
library(copula)
persp(surClaytonCopula(1.5), dCopula, zlim = c(0, 10))
persp(r90ClaytonCopula(-1.5), dCopula, zlim = c(0, 10))
persp(r270ClaytonCopula(-1.5), dCopula, zlim = c(0, 10))
Survival and rotated Clayton copula models
Description
A class representing rotated versions of the Clayton copula family (survival, 90 and 270 degree rotated).
Objects from the Class
Objects can be created by calls of the form
new("surClaytonCopula", ...)
, new("r90ClaytonCopula", ...)
and
new("r270ClaytonCopula", ...)
or by the function
surClaytonCopula()
, r90ClaytonCopula()
and
r270ClaytonCopula()
respectively.
See Also
VineCopula-package()
Examples
library(copula)
persp(surClaytonCopula(.5), dCopula, zlim = c(0, 10))
persp(r90ClaytonCopula(-.5), dCopula, zlim = c(0, 10))
persp(r270ClaytonCopula(-.5), dCopula, zlim = c(0, 10))
Constructors for survival and rotated Gumbel Copulas
Description
These are wrappers to functions from VineCopula-package()
Usage
surGumbelCopula(param = 1)
r90GumbelCopula(param = -1)
r270GumbelCopula(param = -1)
Arguments
param |
A single parameter defining the Copula. |
Value
An object of class surGumbelCopula, r90GumbelCopula or r270GumbelCopula respectively.
Examples
library(copula)
persp(surGumbelCopula(1.5), dCopula, zlim = c(0, 10))
persp(r90GumbelCopula(-1.5), dCopula, zlim = c(0, 10))
persp(r270GumbelCopula(-1.5), dCopula, zlim = c(0, 10))
Survival and rotated Gumbel copula models
Description
A class representing rotated versions of the Gumbel copula family (survival, 90 and 270 degree rotated).
Objects from the Class
Objects can be created by calls of the form
new("surGumbelCopula", ...)
, new("r90GumbelCopula", ...)
and
new("r270GumbelCopula", ...)
or by the function
surGumbelCopula()
, r90GumbelCopula()
and
r270GumbelCopula()
respectively.
See Also
VineCopula-package()
Examples
library(copula)
persp(surGumbelCopula(5), dCopula, zlim = c(0, 10))
persp(r90GumbelCopula(-5), dCopula, zlim = c(0, 10))
persp(r270GumbelCopula(-5), dCopula, zlim = c(0, 10))
Constructor for Tawn copulas (type 1)
Description
Constructs an object of the tawnT1Copula (survival
sur
, 90 degree rotated r90
and 270 degree rotated 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
param |
The parameter |
Value
One of the Tawn type 1 copula classes (tawnT1Copula, surTawnT1Copula, r90TawnT1Copula, r270TawnT1Copula).
See Also
tawnT1Copula()
and the package
VineCopula-package()
for implementation details.
Examples
library(copula)
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))
Tawn copula models (type 1)
Description
S4-class representation of the Tawn Copula family of type 1 and rotated versions there of.
Objects from the Class
Objects can be created by calls of the form
new("tawnT1Copula", ...)
, or through the explicit constructors
tawnT1Copula()
, surTawnT1Copula()
,
r90TawnT1Copula()
and r270TawnT1Copula()
respectively.
See Also
tawnT1Copula and the package
VineCopula-package()
for implementation details.
Examples
showClass("tawnT1Copula")
Constructor for Tawn copulas (type 2)
Description
Constructs an object of the tawnT2Copula (survival
sur
, 90 degree rotated r90
and 270 degree rotated r270
)
family for given parameters.
Usage
tawnT2Copula(param = c(2, 0.5))
surTawnT2Copula(param = c(2, 0.5))
r90TawnT2Copula(param = c(-2, 0.5))
r270TawnT2Copula(param = c(-2, 0.5))
Arguments
param |
The parameter |
Value
One of the Tawn type 2 copula classes (tawnT2Copula, surTawnT2Copula, r90TawnT2Copula, r270TawnT2Copula).
See Also
tawnT2Copula()
and the package
VineCopula-package()
for implementation details.
Examples
library(copula)
persp(tawnT2Copula(), dCopula, zlim = c(0, 10))
persp(surTawnT2Copula(), dCopula, zlim = c(0, 10))
persp(r90TawnT2Copula(), dCopula, zlim = c(0, 10))
persp(r270TawnT2Copula(), dCopula, zlim = c(0, 10))
Tawn copula models (type 2)
Description
S4-class representation of the Tawn Copula family of type 2 and rotated versions there of.
Objects from the Class
Objects can be created by calls of the form
new("tawnT2Copula", ...)
, or through the explicit constructors
tawnT2Copula()
, surTawnT2Copula()
,
r90TawnT2Copula()
and r270TawnT2Copula()
respectively.
See Also
tawnT2Copula and the package
VineCopula-package()
for implementation details.
Examples
showClass("tawnT2Copula")
Constructor of the Class vineCopula
.
Description
Constructs an instance of the vineCopula
class.
Usage
vineCopula(RVM, type = "CVine")
Arguments
RVM |
An object of class |
type |
A predefined type if only the dimension is provided and ignored otherwise, the default is a canonical vine |
Value
An instance of the vineCopula
class.
Author(s)
Benedikt Graeler
References
Aas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple dependence Insurance: Mathematics and Economics 44 (2), 182-198.
Examples
# a C-vine of independent copulas
vine <- vineCopula(4L, "CVine")
library(copula)
library(lattice)
cloud(V1 ~ V2 + V3, as.data.frame(rCopula(500, vine)))
Class "vineCopula"
Description
A class representing vine copulas in a object oriented implementations. Many
functions go back to the package VineCopula-package
Objects from the Class
Objects can be created by calls of the form
new("vineCopula", ...)
or through the function
vineCopula
.
Author(s)
Benedikt Graeler
References
Aas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple dependence Insurance: Mathematics and Economics 44 (2), 182-198.
See Also
RVineMatrix
from package
VineCopula-package
Examples
showClass("vineCopula")