Vine copulas
vine_copula.RdA C- or D-vine copula built from bivariate pair copulas (Aas et al.
2009). pair_copula() is one: a family, its parameter and a rotation by
0, 90, 180 or 270 degrees (for Clayton, Gumbel and Joe; 90 and 270 give
negative dependence; pyvinecopulib's conventions). In a C-vine, tree t
joins the t-th variable in the order to every later one, given those
before; in a D-vine, variables t places apart in the order, given those
between. Each edge's first argument is its earlier variable. Fewer trees
than d - 1 truncate the vine (the rest independence).
copula_log_density() is the vine's log-density.
Arguments
- kind
"c"or"d".- order
The dimensions (1, 2, ...) in vine order.
- pairs
A list of trees, tree
ta list of itsd - tpair copulas.- family
One of
"independence","gaussian","student","clayton","gumbel","frank"and"joe".- parameter
Gaussian and Student t correlation in (-1, 1); Clayton above 0; Gumbel and Joe at least 1; Frank not 0.
- rotation
0, 90, 180 or 270 (0 for the Student t).
- nu
The Student t's degrees of freedom;
NULLfor the others.- copula
A vine copula.
- u
A point or a matrix with one point per row.
Value
pair_copula(): a list; vine_copula(): a copula;
copula_log_density(): one value per point.
Examples
v <- vine_copula("d", 1:3, list(
list(pair_copula("gumbel", 2), pair_copula("clayton", 1.5, 90)),
list(pair_copula("frank", 3))))
copula_log_density(v, c(0.2, 0.7, 0.4))
#> [1] -0.7059568
copula_sample(v, 3, seed = 1)
#> [,1] [,2] [,3]
#> [1,] 0.1583447 0.5199504 0.2647757
#> [2,] 0.1263656 0.1158140 0.2534681
#> [3,] 0.3262239 0.6133059 0.3710136