VinecopBase.fit

static VinecopBase.fit(structure, u, fit_edge, *, context=None, x=None)

Fit pair copulas tree-by-tree along a fixed structure (returns them).

The array-agnostic (NumPy or PyTorch) analogue of fit(), with the pair-copula fit supplied by the fit_edge callback. It differs in one way: rather than mutating a vine in place (as fit() does), it returns the fitted pairs as a nested [tree][edge] list — since VinecopBase leaves pair storage to the subclass, there is no single object to mutate. It mirrors the forward pdf traversal with the density evaluation replaced by fit_edge(tree, edge, u_e, x_e); the returned pair’s hfunc1 / hfunc2 must be valid immediately for tree propagation. Conditional fitting is driven through this seam (a fit_edge that fits a conditional pair copula on (u_e, x_e)), with x_e assembled in the same C1 order the cascades use.

Parameters:
structureRVineStructure

The (fixed) vine structure to fit along.

uarray, shape (n, d), dtype float

Pseudo-observations.

fit_edgecallable

(tree, edge, u_e, x_e) -> BicopLike fitting one edge’s pair copula.

contextConditioningContext, optional

Conditioning-context policy (default: simplified / unconditional).

xarray, shape (n, p), or None, optional

External covariates for conditional fitting, else None.

Returns:
list of list of BicopLike

Fitted pair copulas indexed [tree][edge].

See also

pyvinecopulib.core.VinecopBase.select

Select a structure and fit it.

pyvinecopulib.core.Vinecop.fit

The reference (in-place) fit.