numeraire.backtest_pricing#

numeraire.backtest_pricing(estimator: Estimator, view: Any, splitter: Any, *, method: str, config: dict[str, Any] | None = None, data_vintage: str = 'unknown', run_id: str | None = None, n_jobs: int = 1) PricingOutput[source]#

Walk-forward OOS pricing of a to_pricing estimator: pooled predicted vs realized panels.

Mirrors backtest_weights(): for each (train, test) fold the estimator is fit on the PIT train window and its fitted model prices the test window via expected_returns(); realized (t, t+h] returns are pulled from the full view (never the model), and the per-fold cross-sections are pooled into one (date x asset) panel pair tagged protocol="walk_forward". Works on a TimeSeriesView (SDF-style N-asset block) or a CrossSectionView (characteristic panel). n_jobs fans the folds over a thread pool (-1 = all cores); order-preserving, so identical output.