TorchVinecop.select
- static TorchVinecop.select(u, fit_edge, *, trunc_lvl=None, tree_criterion='tau', threshold=0.0, tree_algorithm='mst_prim', seeds=None, to_numpy=None)
Select an R-vine structure from data (array-agnostic Dissmann).
The array-agnostic (NumPy or PyTorch) analogue of
select(), with the pair-copula fit supplied by thefit_edgecallback. It differs in one way: rather than mutating a vine in place (asselect()does), it returns the selected structure and pairs —VinecopBaseleaves pair storage to the subclass, so there is no single object to mutate. It runs the tree-by-tree Dissmann greedy search [1]: for each tree it builds a candidate graph honoring the proximity condition, weights every candidate edge by1 - |tau|(tauis the dependence measure named bytree_criterion, Kendall’s tau by default, viawdm), and keeps a spanning tree (tree_algorithm) — maximum-dependence for the MST variants, Wilson-weighted random for the random ones. Each surviving edge’s pair copula is fit by thefit_edgecallback, whose h-functions feed the next tree.The fitted pairs are returned reused, never re-fit: each is placed on its slot in the finalized structure and reoriented with its
flip()where the slot’s orientation requires it. Selection is for a simplified vine — edge weights use the unconditional pseudo-observations, sofit_edgereceivesx_e = None.- Parameters:
- uarray, shape (n, d), dtype float
Pseudo-observations on any array-API namespace (NumPy or PyTorch).
- fit_edgecallable
(tree, edge, u_e, x_e) -> BicopLikefitting one edge’s pair copula; itshfunc1/hfunc2must be valid immediately, and it must implementflip()(used to reorient reused pairs onto their finalized slots).x_eis alwaysNonehere.- trunc_lvlint, optional
Maximum number of trees to select (default:
d - 1, i.e. untruncated).- tree_criterionstr, default “tau”
Dependence measure passed to
wdmfor edge weighting (e.g."tau","rho","hoeffd").- thresholdfloat, default 0.0
Dependence threshold: edges with criterion below it are deprioritized (weight
1.0) during spanning-tree selection.- tree_algorithmstr, default “mst_prim”
"mst_prim"/"mst_kruskal"(Dissmann) or"random_weighted"/"random_unweighted"(Wilson).- seedslist of int, optional
RNG seeds for the random tree algorithms (ignored by the MST ones).
- to_numpycallable, optional
Maps a 1-d array to a NumPy array for the
wdmcall. Defaults tonumpy.asarray(); PyTorch callers pass one that detaches and moves to host (e.g.lambda t: t.detach().cpu().numpy()).
- Returns:
- structureRVineStructure
The selected vine structure.
- pair_copulaslist of list of BicopLike
The fitted pair copulas, indexed
[tree][edge]in the structure’s column order and reoriented onto their slots — ready to host in a vine without re-fitting.
See also
pyvinecopulib.core.VinecopBase.fitFit pair copulas along a fixed structure.
pyvinecopulib.core.Vinecop.selectThe reference (in-place) selector.
References
[1]Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.