numeraire.backtest_panel#

numeraire.backtest_panel(estimator: Estimator, view: CrossSectionView, splitter: Any, *, method: str, config: dict[str, Any] | None = None, data_vintage: str = 'unknown', run_id: str | None = None, n_jobs: int = 1, missing_returns: Literal['error', 'zero', 'renormalize_legs'] = 'error') PanelWeightsOutput[source]#

Walk-forward OOS backtest of a cross-sectional to_weights estimator over a ragged panel.

Mirrors backtest_weights() but for CrossSectionView: the fitted model returns long (date, asset) target weights and realized forward returns are aligned by key. Only the mechanically unrealized horizon tail is removed; an earlier missing held return follows missing_returns (default "error"). "renormalize_legs" rescales the observed positive and negative legs separately, preserving target gross/net exposure. n_jobs fans folds over a thread pool (-1 = all cores); output order is deterministic. Each fold fits an isolated copy.deepcopy of estimator — never the caller’s instance — so folds stay order- and schedule-independent; the estimator must be deepcopy-able and must not share fit-relevant mutable state across copies (see backtest_weights()).