Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rnacopula

Sampling Nested Archimedean Copulas


Description

Random number generation for nested Archimedean copulas (of class outer_nacopula, specifically), aka sampling nested Archimedean copulas will generate n random vectors of dimension d (= dim(x)).

Usage

rnacopula(n, copula, x, ...)

Arguments

n

integer specifying the sample size, that is, the number of copula-distributed random vectors U_i, to be generated.

copula

an R object of class "outer_nacopula", typically from onacopula().

x

only for back compatibility: former name of copula argument.

...

possibly further arguments for the given copula family.

Details

The generation happens by calling rnchild() on each child copula (which itself recursively descends the tree implied by the nested Archimedean structure). The algorithm is based on a mixture representation of the generic distribution functions F0 and F01 and is presented in McNeil (2008) and Hofert (2011a). Details about how to efficiently sample the distribution functions F0 and F01 can be found in Hofert (2010), Hofert (2012), and Hofert and Mächler (2011).

Value

numeric matrix containing the generated vectors of random variates from the nested Archimedean copula object copula.

References

McNeil, A. J. (2008). Sampling nested Archimedean copulas. Journal of Statistical Computation and Simulation 78, 6, 567–581.

Hofert, M. (2010). Efficiently sampling nested Archimedean copulas. Computational Statistics & Data Analysis 55, 57–70.

Hofert, M. (2012), A stochastic representation and sampling algorithm for nested Archimedean copulas. Journal of Statistical Computation and Simulation, 82, 9, 1239–1255.

Hofert, M. (2012). Sampling exponentially tilted stable distributions. ACM Transactions on Modeling and Computer Simulation 22, 1 (3rd article).

Hofert, M. and Mächler, M. (2011). Nested Archimedean Copulas Meet R: The nacopula Package. Journal of Statistical Software 39, 9, 1–20.

See Also

rnchild; classes "nacopula" and "outer_nacopula"; see also onacopula(). rnacModel creates random nacopula models, i.e., the input copula for rnacopula(n, copula).

Further, those of the Archimedean families, for example, copGumbel.

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 :
C3 <- onacopula("C", C(copClayton@iTau(0.2), 1,
                       C(copClayton@iTau(0.5), c(2,3))))
C3

## Sample n vectors of random variates from this copula.  This involves
## sampling exponentially tilted stable distributions
n <- 1000
U <- rnacopula(n, C3)

## Plot the drawn vectors of random variates
splom2(U)

copula

Multivariate Dependence with Copulas

v1.0-1
GPL (>= 3) | file LICENCE
Authors
Marius Hofert [aut] (<https://orcid.org/0000-0001-8009-4665>), Ivan Kojadinovic [aut] (<https://orcid.org/0000-0002-2903-1543>), Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Jun Yan [aut] (<https://orcid.org/0000-0003-4401-7296>), Johanna G. Nešlehová [ctb] (evTestK(), <https://orcid.org/0000-0001-9634-4796>), Rebecca Morger [ctb] (fitCopula.ml(): code for free mixCopula weight parameters)
Initial release
2020-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.