API reference#
The API is organised in three layers: the top-level numeraire namespace (the common surface,
re-exported for convenience), the numeraire.core spine, and the core-adjacent infrastructure
(testing, reference, comparison, baselines, adapters).
- numeraire
- numeraire.core.data
- numeraire.core.engine
- numeraire.core.evaluators
- numeraire.core.protocols
- numeraire.core.capabilities
- numeraire.core.schema
- numeraire.core.registry
- numeraire.core.simulate
- numeraire.core.splitter
- numeraire.core.stats
- numeraire.core.sorts
- numeraire.testing
- numeraire.reference
- numeraire.comparison
- numeraire.baselines
- numeraire.adapters.skfolio_adapter
Top-level namespace#
The most common classes and functions are re-exported at the top level, so
from numeraire import TimeSeriesView, backtest, SharpeEvaluator works directly.
A point-in-time view: a returns (decision) calendar + one or more aligned feature blocks. |
|
A cross-sectional (panel) view: many assets with per-asset characteristics, ragged over time. |
|
Expanding- or rolling-window walk-forward splitter. |
|
Split a (train) view into PIT |
|
Backtest |
|
Run a walk-forward OOS backtest of a |
|
Walk-forward OOS backtest of a cross-sectional |
|
Walk-forward pseudo-OOS forecast (forecast-origin convention; GW2008 / 1-A / VoC). |
|
Walk-forward OOS pricing of a |
|
In-sample pricing: one full-sample fit, expected returns over the whole view ( |
|
Stable short hash of a JSON-serializable config dict (preprocessing provenance). |
|
OOS output for a |
|
OOS output for a cross-sectional |
|
OOS output for a |
|
Output for a |
|
Annualized Sharpe ratio of the realized strategy returns (the timing headline). |
|
Annualized mean of the realized strategy returns. |
|
DGU (2009) certainty-equivalent return of the realized strategy returns (economic value). |
|
Time-series alpha of the strategy vs a factor benchmark (HAC t-stat). |
|
Per-period (time-indexed) realized strategy return — one result row per date. |
|
Out-of-sample R^2 of a forecast vs a benchmark, |
|
Per-origin squared-error difference (benchmark minus model), one row per date. |
|
Clark-West (2007) MSPE-adjusted test of the forecast against its nested benchmark. |
|
Cross-sectional R^2 of mean realized returns on mean predicted expected returns (OLS). |
|
Average absolute pricing error (mean over assets of |
|
A point-in-time aligned view of the data. |
|
scikit-learn-compatible. |
|
A fitted model. |
|
Yields (train, test) views — purge/embargo/PIT aware. |
|
Scores OOS output, emitting rows of the standard tidy result schema. |
|
Capability protocol (v0): a model that emits portfolio/timing weights ( |
|
Capability protocol (v0): a model that emits a next-horizon return forecast. |
|
Capability protocol: a model that prices a cross-section of test assets ( |
|
Raise |
|
Register |
|
Return the evaluator registered under |
|
Return the names of all registered evaluators, sorted. |
|
Simulate a target-weight stream over data-frequency returns (conventions in module doc). |
|
Decision (signal) dates mapped to the half-open data-row spans they govern. |
|
Realized simulation output plus the accounting provenance every result row needs. |
|
Cross-sectional |
|
Per-period sorted-portfolio returns plus the long-short spread. |
|
Gibbons-Ross-Shanken (1989) test that all time-series alphas are jointly zero. |
|
Jobson-Korkie (1981) z-test of equal Sharpe ratios with the Memmel (2003) correction. |
|
Clark-West (2007) MSPE-adjusted test for nested models. |
|
OLS of portfolio (excess) returns on factor returns; HAC (Bartlett) coefficient errors. |
|
Multiple-testing adjustment for a family of tests (Harvey-Liu-Zhu 2016 §4.4 toolbox). |
|
Bartlett-kernel long-run variance of a 1-D series ( |
|
DGU (2009) eq. |
|
DGU (2009) eq. |
|
Quadratic-utility performance fee (Fleming-Kirby-Ostdiek; Kirby-Ostdiek 2012 eq. |