dnacopula: Density Evaluation for (Nested) Archimedean Copulas

View source: R/nacopula.R

dnacopulaR Documentation

Density Evaluation for (Nested) Archimedean Copulas


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.


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

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


copula, x

an object of class "outer_nacopula".


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.


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).


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))).


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


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


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.


## 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 documentation built on June 15, 2022, 5:07 p.m.