Learn R Programming

copula (version 0.999-7)

cCopula: Conditional Copula Function

Description

Compute the conditional distribution aka conditional copula function, $C(u_d\,|\,u_1,\dots,u_{d-1})$ of $u_d$ given $u_1,\dots,u_{d-1}$.

Usage

cCopula(u, copula, j.ind=ncol(u), n.MC=0, log=FALSE)

## Deprecated, for Archimedean copulas only: cacopula(u, cop, n.MC=0, log=FALSE)

Arguments

u
$n\times d$-matrix; the conditioning is done on the values in the first $d-1$ columns.
copula
any "copula" with specified parameters; currently only Archimedean and elliptical copulas provided.
j.ind
indices $j\ge 2$ for which $C(u_j\,|\,u_1,\dots,u_{j-1})$ is computed.
cop
"outer_nacopula" with specified parameters (only Archimedean copulas are currently provided).
n.MC
Monte Carlo sample size; for Archimedean copulas only, used if positive.
log
if TRUE the logarithm of the conditional copula function is returned.

Value

  • numeric vector of length $n$ containing the conditional copula function of $u_d$ given $u_1,\dots,u_{d-1}$.

Details

cCopula() can be seen as a special case of the Rosenblatt transform which by default computes all conditional distributions. Conseqently, cCopula() simply calls rtrafo().

See Also

rtrafo; acopula-families.

Examples

Run this code
tau <- 0.5
(theta <- copGumbel@iTau(tau)) # 2
d <- 2
# two ways to specify a Gumbel copula:
cop  <- onacopulaL("Gumbel", list(theta,1:d))
gCop <- gumbelCopula(theta, dim=d) #

n <- 1000
set.seed(1)
U <- rCopula(n, cop)

U. <- cbind(U[,1], cCopula(U, cop=cop)) # should be ~ U[0,1]^2
plot(U.[,1],U.[,2])
stopifnot(all.equal(cacopula(U, cop),# with deprecation warning
                      cCopula(U, cop)))
## more examples:  -->  ?rtrafo % ./gtrafo.Rd

Run the code above in your browser using DataLab