Draws uniforms on \([0,1]^d\) from elliptical (Gaussian, t) or
Archimedean (Clayton, Gumbel, Frank) copulas. Archimedean copulas in
dimension d > 2 are sampled with the Marshall--Olkin frailty algorithm;
the bivariate Frank copula also allows negative dependence (theta < 0),
sampled by conditional inversion.
Usage
r_copula(
n,
family = c("gaussian", "t", "clayton", "gumbel", "frank", "independence"),
dim = 2L,
corr = NULL,
df = 4,
theta = NULL,
seed = NULL
)
Value
An n x dim matrix of uniforms.
Arguments
n
Number of draws.
family
Copula family.
dim
Dimension (ignored when corr is given).
corr
Correlation matrix for elliptical copulas (default:
exchangeable with rho = 0.5). It must have a unit diagonal; a
covariance matrix is rejected (convert it with stats::cov2cor()).
df
Degrees of freedom for the t copula: a positive number;
Inf gives the Gaussian copula.
theta
Archimedean parameter: Clayton theta > 0, Gumbel
theta >= 1, Frank theta != 0 (> 0 when dim > 2).
seed
Optional random seed.
References
Marshall, A. W. and Olkin, I. (1988). Families of multivariate
distributions. Journal of the American Statistical Association,
83(403), 834--841. tools:::Rd_expr_doi("10.1080/01621459.1988.10478671")
Hofert, M. (2008). Sampling Archimedean copulas. Computational
Statistics & Data Analysis, 52(12), 5163--5174.
tools:::Rd_expr_doi("10.1016/j.csda.2008.05.019")