pnacopula: Evaluation of (Nested) Archimedean Copulas

View source: R/nacopula.R

pnacopulaR Documentation

Evaluation of (Nested) Archimedean Copulas

Description

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

Usage

## S4 method for signature 'matrix,nacopula'
pCopula(u, copula, ...)

## *Deprecated*:
pnacopula(x, u)

Arguments

copula, x

(nested) Archimedean copula of dimension d, that is, an object of class nacopula, typically from onacopula(..).

u

a numeric vector of length d or matrix with d columns.

...

unused: potential optional arguments passed from and to methods.

Details

The value of an Archimedean copula C with generator \psi at u is given by

C(\bm{u})=\psi(\psi^{-1}(u_1)+\dots+\psi^{-1}(u_d)),\ \bm{u}\in[0,1]^d.

The value of a nested Archimedean copula is defined similarly. Note that a d-dimensional copula is called nested Archimedean if it is an Archimedean copula with arguments possibly replaced by other nested Archimedean copulas.

Value

A numeric in [0,1] which is the copula evaluated at u. (Currently not parallelized.)

Note

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

Examples

## Construct a three-dimensional nested Joe copula with parameters
## chosen such that the Kendall's tau of the respective bivariate margins
## are 0.2 and 0.5.
theta0 <- copJoe@iTau(.2)
theta1 <- copJoe@iTau(.5)
C3 <- onacopula("J", C(theta0, 1, C(theta1, c(2,3))))

## Evaluate this copula at the vector u
u <- c(.7,.8,.6)
pCopula(u, C3)

## Evaluate this copula at the matrix v
v <- matrix(runif(300), ncol=3)
pCopula(v, C3)

## Back-compatibility check
stopifnot(identical( pCopula (u, C3), suppressWarnings(
                    pnacopula(C3, u))),
          identical( pCopula (v, C3), suppressWarnings(
                    pnacopula(C3, v))))

copula documentation built on Sept. 11, 2024, 7:48 p.m.