RVineStructure.from_trees
- RVineStructure.from_trees(d: int, trees: collections.abc.Sequence[collections.abc.Sequence[tuple[int, int, collections.abc.Sequence[int]]]]) pyvinecopulib.core.RVineStructure
Assemble an
RVineStructurefrom a list-of-trees decomposition.Faithful inverse of
get_trees(): the R-vine matrix is assembled placing each edge’s first conditioned variableaon the diagonal, soRVineStructure.from_trees(s.dim, s.get_trees())reproducessexactly. The diagonal choice fixes the variable order — and hence which variables sit at its tail, which is whatsimulate_conditionalconditions 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, whereaandbare the conditioned pair (ais placed on the matrix diagonal) andconditioningis the (possibly empty) conditioning set. Treetmust contain exactlyd - 1 - tedges. 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_treesThe decomposition this method inverts.