Create custom vine copula models by specifying the pair-copulas, structure, and variable types.
Arguments
- pair_copulas
A nested list of '
bicop_dist()' objects, wherepair_copulas[[t]][[e]]corresponds to the pair-copula at edgeein treet.- structure
an
rvine_structureobject, namely a compressed representation of the vine structure, or an object that can be coerced into one (seervine_structure()andas_rvine_structure()). The dimension must belength(pair_copulas[[1]]) + 1;structure = NAperforms automatic selection based on Dissman's algorithm. See Details for partial selection of the structure.- var_types
variable types, a length d vector; e.g.,
c("c", "c")for two continuous variables, orc("c", "d")for first variable continuous and second discrete.
Value
Object of class vinecop_dist, i.e., a list containing:
pair_copulas, a list of lists. Each element ofpair_copulascorresponds to a tree, which is itself a list ofbicop_dist()objects.structure, a compressed representation of the vine structure, or an object that can be coerced into one (seervine_structure()andas_rvine_structure()).npars, anumericwith the number of (effective) parameters.var_typesthe variable types.
Examples
# specify pair-copulas
bicop <- bicop_dist("bb1", 90, c(3, 2))
pcs <- list(
list(bicop, bicop), # pair-copulas in first tree
list(bicop) # pair-copulas in second tree
)
# specify R-vine matrix
mat <- matrix(c(1, 2, 3, 1, 2, 0, 1, 0, 0), 3, 3)
# set up vine copula model
vc <- vinecop_dist(pcs, mat)
# visualization
plot(vc)
#> Error in plot.vinecop_dist(vc): The 'ggraph' package must be installed to plot.
contour(vc)
# simulate from the model
pairs(rvinecop(200, vc))