Custom S-vine models
A nested list of 'bicop_dist' objects, where
pair_copulas[[t]][[e]]
corresponds to the pair-copula at edge e
in tree
t
. Only the most-left unique pair copulas are used, others can be omitted.
The cross-sectional structure. Either a matrix, or an
rvine_structure
object; see rvinecopulib::rvine_structure()
the Markov order.
the out-vertex; if NA
, the out-vertex is selected
automatically if no structure is provided, and is equivalent to 1 if a
structure is provided.
the in-vertex; if NA
, the in-vertex is selected
automatically if no structure is provided, and is equivalent to 1 if a
structure is provided.
variable types; discrete variables not (yet) allowed.
Returns the model as an object with classes
svinecop_dist
. Also inherits from vinecop_dist
such that many functions from rvinecopulib can be called.
cs_struct <- cvine_structure(1:2)
pcs <- list(
list( # first tree
bicop_dist("clayton", 0, 3), # cross sectional copula
bicop_dist("gaussian", 0, -0.1) # serial copula
),
list( # second tree
bicop_dist("gaussian", 0, 0.2), bicop_dist("indep")
),
list( # third tree
bicop_dist("indep")
)
)
cop <- svinecop_dist(
pcs, cs_struct, p = 1, out_vertices = 1:2, in_vertices = 1:2)