rnchild {copula}R Documentation

Sampling Child 'nacopula's

Description

Method for generating vectors of random numbers of nested Archimedean copulas which are child copulas.

Usage

rnchild(x, theta0, V0, ...)

Arguments

x

an "nacopula" object, typically emerging from an "outer_nacopula" object constructed with onacopula().

theta0

the parameter (vector) of the parent Archimedean copula which contains x as a child.

V0

a numeric vector of realizations of V_{0} following F_{0} whose length determines the number of generated vectors, that is, for each realization V_{0}, a vector of variates from x is generated.

...

possibly further arguments for the given copula family.

Details

The generation is done recursively, descending the tree implied by the nested Archimedean structure. The algorithm is based on a mixture representation and requires sampling V_{01}\sim F_{01} given random variates V_0\sim F_{0}. Calling "rnchild" is only intended for experts. The typical call of this function takes place through rnacopula().

Value

a list with components

U

a numeric matrix containing the vector of random variates from the child copula. The number of rows of this matrix therefore equals the length of V_{0} and the number of columns corresponds to the dimension of the child copula.

indcol

an integer vector of indices of U (the vector following a nested Archimedean copula of which x is a child) whose corresponding components of U are arguments of the nested Archimedean copula x.

See Also

rnacopula, also for the references. Further, classes "nacopula" and "outer_nacopula"; see also onacopula().

Examples

## Construct a three-dimensional nested Clayton copula with parameters
## chosen such that the Kendall's tau of the respective bivariate margins
## are 0.2 and 0.5.
theta0 <- copClayton@iTau(.2)
theta1 <- copClayton@iTau(.5)
C3 <- onacopula("C", C(theta0, 1, C(theta1, c(2,3))))
## Sample n random variates V0 ~ F0 (a Gamma(1/theta0,1) distribution)
n <- 1000
V0 <- copClayton@V0(n, theta0)

## Given these variates V0, sample the child copula, that is, the bivariate
## nested Clayton copula with parameter theta1
U23 <- rnchild(C3@childCops[[1]], theta0, V0)

## Now build the three-dimensional vectors of random variates by hand
U1 <- copClayton@psi(rexp(n)/V0, theta0)
U <- cbind(U1, U23$U)

## Plot the vectors of random variates from the three-dimensional nested
## Clayton copula
splom2(U)

[Package copula version 1.1-3 Index]