| r_copula | R Documentation |
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.
r_copula(
n,
family = c("gaussian", "t", "clayton", "gumbel", "frank", "independence"),
dim = 2L,
corr = NULL,
df = 4,
theta = NULL,
seed = NULL
)
n |
Number of draws. |
family |
Copula family. |
dim |
Dimension (ignored when |
corr |
Correlation matrix for elliptical copulas (default:
exchangeable with |
df |
Degrees of freedom for the t copula: a positive number;
|
theta |
Archimedean parameter: Clayton |
seed |
Optional random seed. |
An n x dim matrix of uniforms.
Marshall, A. W. and Olkin, I. (1988). Families of multivariate distributions. Journal of the American Statistical Association, 83(403), 834–841. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.1988.10478671")}
Hofert, M. (2008). Sampling Archimedean copulas. Computational Statistics & Data Analysis, 52(12), 5163–5174. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.csda.2008.05.019")}
u <- r_copula(1000, "clayton", dim = 3, theta = 2, seed = 1)
cor(u, method = "kendall") # theoretical tau = theta / (theta + 2) = 0.5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.