Skip to contents

Dependence structures that draw uniforms, one vector per simulation. gaussian_copula() and t_copula() take a correlation matrix; t_copula() adds joint extremes through its degrees of freedom. archimedean_copula() is exchangeable: Clayton (lower-tail dependence), Gumbel and Joe (upper-tail dependence) or Frank (none). Kendall's tau is (2 / pi) * asin(r) for the Gaussian and t copulas, theta / (theta + 2) for Clayton and 1 - 1 / theta for Gumbel.

Usage

copula(ptr)

gaussian_copula(correlation)

t_copula(correlation, nu)

archimedean_copula(
  family = c("clayton", "gumbel", "frank", "joe"),
  theta,
  dim = 2
)

Arguments

ptr

Internal: an existing copula to wrap.

correlation

A symmetric correlation matrix, positive definite.

nu

Degrees of freedom, positive.

family

One of "clayton", "gumbel", "frank" and "joe".

theta

Positive for Clayton and Frank; at least 1 for Gumbel and Joe.

dim

Number of dimensions.

Value

A copula object with dimension and description properties. Use it with copula_sample() and copula_simulate().

Examples

r <- matrix(c(1, 0.5, 0.5, 1), 2)
copula_sample(gaussian_copula(r), 3, seed = 1)
#>           [,1]      [,2]
#> [1,] 0.1583447 0.6435332
#> [2,] 0.1263656 0.1386217
#> [3,] 0.3262239 0.7234064
t_copula(r, nu = 4)
#> <copula> Student t, nu = 4, dimension 2
archimedean_copula("clayton", 2, dim = 3)
#> <copula> Clayton, theta = 2, dimension 3