Learn R Programming

copula (version 0.999-1)

cacopula: Conditional copula function

Description

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

Usage

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.
cop
"outer_nacopula" with specified parameters (only Archimedean copulas are currently provided).
n.MC
Monte Carlo sample size.
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}$.

See Also

acopula-families.

Examples

Run this code
tau <- 0.5
(theta <- copGumbel@tauInv(tau)) # 2
d <- 2
(cop <- onacopulaL("Gumbel", list(theta,1:d)))

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

U. <- cbind(U[,1], cacopula(U, cop=cop)) # should be ~ U[0,1]^2
plot(U.[,1],U.[,2])

Run the code above in your browser using DataLab