rnchild | R Documentation |
Method for generating vectors of random numbers of nested Archimedean copulas which are child copulas.
rnchild(x, theta0, V0, ...)
x |
an |
theta0 |
the parameter (vector) of the parent Archimedean copula
which contains |
V0 |
a |
... |
possibly further arguments for the given copula family. |
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()
.
a list with components
U |
a |
indcol |
an |
rnacopula
, also for the references.
Further, classes "nacopula"
and
"outer_nacopula"
; see also onacopula()
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.