numeraire.backtest_forecast#
- numeraire.backtest_forecast(estimator: Estimator, view: TimeSeriesView, *, min_train: int = 20, window: int | None = None, horizon: int | None = None, refit_every: int = 1, method: str, config: dict[str, Any] | None = None, data_vintage: str = 'unknown', run_id: str | None = None, n_jobs: int = 1) ForecastOutput[source]#
Walk-forward pseudo-OOS forecast (forecast-origin convention; GW2008 / 1-A / VoC).
At each origin
tthe model is fit on the window of data ending at and includingt(rolling ifwindowis given, else expanding from the start withmin_trainwarm-up) and asked to forecast the return over(t, t+h]; the engine records the realized return and the window historical-mean benchmark. No look-ahead: the forecast uses only data<= tand the target is strictly future.refit_everydecouples the refit cadence from the prediction cadence (the ML-cross-section protocol: e.g. annual refits with monthly predictions =refit_every=12on a monthly calendar): the model is re-fit on everyrefit_every-th origin and reused for the origins in between, whose forecasts still consume each origin’s own up-to-date PIT window (fresh features, stale parameters — never stale information). The benchmark stays the per-origin prevailing mean regardless. Includerefit_everyinconfigfor provenance if you sweep it.n_jobsfans the independent refit blocks over a thread pool (-1= all cores); results are order-preserved, so the output is identical ton_jobs=1.