Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dnacopula

Density Evaluation for (Nested) Archimedean Copulas


Description

For a (nested) Archimedean copula (object of class nacopula) x, dCopula(u, x) (or also currently still dnacopula(x, u)) evaluates the density of x at the given vector or matrix u.

Usage

## S4 method for signature 'matrix,nacopula'
dCopula(u, copula, log=FALSE, ...)

## *Deprecated*:
dnacopula(x, u, log=FALSE, ...)

Arguments

copula, x

an object of class "outer_nacopula".

u

argument of the copula x. Note that u can be a matrix in which case the density is computed for each row of the matrix and the vector of values is returned.

log

logical indicating if the log of the density should be returned.

...

optional arguments passed to the copula's dacopula function (slot), such as n.MC (non-negative integer) for possible Monte Carlo evaluation (see dacopula in acopula).

Details

If it exists, the density of an Archimedean copula C with generator psi at u in (0,1) is given by

c(u) = psi^{(d)}(psi^{-1}(u_1)+...+psi^{-1}(u_d)) prod(j=1..d) (psi^{-1}(u_j))' = psi^{(d)}(psi^{-1}(u_1)+...+psi^{-1}(u_d)) / (psi'(psi^{-1}(u_1))*...*psi'(psi^{-1}(u_d))).

Value

A numeric vector containing the values of the density of the Archimedean copula at u.

Note

dCopula(u, copula) is a generic function with methods for all our copula classes, see dCopula.

References

Hofert, M., Mächler, M., and McNeil, A. J. (2012). Likelihood inference for Archimedean copulas in high dimensions under known margins. Journal of Multivariate Analysis 110, 133–150.

Hofert, M., Mächler, M., and McNeil, A. J. (2013). Archimedean Copulas in High Dimensions: Estimators and Numerical Challenges Motivated by Financial Applications. Journal de la Société Française de Statistique 154(1), 25–63.

See Also

For more details about the derivatives of an Archimedean generator, see, for example, absdPsi in class acopula.

Examples

## Construct a twenty-dimensional Gumbel copula with parameter chosen
## such that Kendall's tau of the bivariate margins is 0.25.
theta <- copJoe@iTau(.25)
C20 <- onacopula("J", C(theta, 1:20))

## Evaluate the copula density at the point u = (0.5,...,0.5)
u <- rep(0.5, 20)
dCopula(u, C20)

## the same with Monte Carlo based on 10000 simulated "frailties"
dCopula(u, C20, n.MC = 10000)

## Evaluate the exact log-density at several points
u <- matrix(runif(100), ncol=20)
dCopula(u, C20, log = TRUE)

## Back-compatibility check
stopifnot(identical( dCopula (u, C20), suppressWarnings(
                    dnacopula(C20, u))),
          identical( dCopula (u, C20, log = TRUE), suppressWarnings(
                    dnacopula(C20, u, log = TRUE))))

copula

Multivariate Dependence with Copulas

v1.0-1
GPL (>= 3) | file LICENCE
Authors
Marius Hofert [aut] (<https://orcid.org/0000-0001-8009-4665>), Ivan Kojadinovic [aut] (<https://orcid.org/0000-0002-2903-1543>), Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Jun Yan [aut] (<https://orcid.org/0000-0003-4401-7296>), Johanna G. Nešlehová [ctb] (evTestK(), <https://orcid.org/0000-0001-9634-4796>), Rebecca Morger [ctb] (fitCopula.ml(): code for free mixCopula weight parameters)
Initial release
2020-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.