TorchVinecop.from_data
- classmethod TorchVinecop.from_data(u, structure=None, controls=None, var_types=[])
Fit a pure-PyTorch TLL vine on
u.When
structureisNonethe R-vine structure and its pair copulas are selected and fit natively in torch byselect()— the array-agnostic analogue ofVinecop’s Dissmann / Wilson selection (edge weights use Kendall’s tau viawdm).When a
structureis given it is fixed and the pair copulas are fit on it tree by tree (fit()): at each(tree, edge)the pair of pseudo-obs columns is collected by the same rule as the pdf / rosenblatt cascade, aTorchBicopis fit viafrom_data(), andhfunc1/hfunc2propagate forward.Either way the result matches Vinecop’s TLL fit to machine precision when
cache_integrals=False. Structure selection honorscontrols.trunc_lvl/tree_criterion/threshold/tree_algorithm/seeds.- Parameters:
- undarray or Tensor, shape (n, d), dtype float
Pseudo-observations.
- structureRVineStructure or None, default=None
Vine skeleton.
Noneselects one natively in torch (continuous variables only).- controlsFitControlsTorchVinecop or None, default=None
Pair-copula fit controls bundled with the vine-level structure-selection and placement / cascade knobs.
Nonedefaults to TLL on a 30x30 normal-spaced grid, float64,mst_primwithtrunc_lvl=20.- var_typeslist of str, default=[]
Per-variable types; only
"c"(continuous) is supported. Empty means all-continuous.
- Returns:
- TorchVinecop
A fitted
TorchVinecop.
- Raises:
- NotImplementedError
If any
var_typesentry is not"c"(continuous only).
Notes
With
structure=Nonethe selected vine — its variable order, R-vine matrix encoding, and reused pair copulas — reproducesVinecop’s selection on the same data.