CVineStructure.from_trees

CVineStructure.from_trees(d: int, trees: collections.abc.Sequence[collections.abc.Sequence[tuple[int, int, collections.abc.Sequence[int]]]]) pyvinecopulib.core.RVineStructure

Assemble an RVineStructure from a list-of-trees decomposition.

Faithful inverse of get_trees(): the R-vine matrix is assembled placing each edge’s first conditioned variable a on the diagonal, so RVineStructure.from_trees(s.dim, s.get_trees()) reproduces s exactly. The diagonal choice fixes the variable order — and hence which variables sit at its tail, which is what simulate_conditional conditions on.

Parameters:
dint

Dimension of the vine.

treeslist of list of tuple

Per-tree edge lists, indexed [tree][edge]. Each edge is a triple (a, b, conditioning) of 1-based variable labels, where a and b are the conditioned pair (a is placed on the matrix diagonal) and conditioning is the (possibly empty) conditioning set. Tree t must contain exactly d - 1 - t edges. An empty list yields a fully truncated (independence) structure.

Returns:
RVineStructure

The assembled structure. Pair-copulas are not part of the input; callers fit them on the returned structure.

See also

RVineStructure.get_trees

The decomposition this method inverts.