numeraire.comparison.compare#
- numeraire.comparison.compare(entries: Sequence[ComparisonEntry], test_assets: Any, *, evaluators: Sequence[Evaluator] | None = None, data_vintage: str = 'unknown') DataFrame[source]#
Score every entry’s expected returns on one common test-asset panel; return tidy result rows.
Each entry is fit on its own
train_viewand prices the shared test assets through itstest_view(defaulting totrain_view); realized returns always come from the canonicaltest_assetspanel, and asset-label / calendar alignment is verified before scoring. The default evaluators are the two native pricing metrics (CrossSectionalR2Evaluator,AverageAbsAlphaEvaluator); pass an explicit list to add or narrow them.Alignment convention (the
PricingOutputinvariant):predicted.loc[t]prices the return realized over(t, t+h], exactly as in the pricing drivers. Whentest_assetsis a concrete core view, its own horizon-aware pairing (target_asof) supplies the realized panel. When it is a bare(date x asset)frame, horizon 1 is assumed:realized.loc[t]is the panel’s next row (panel.shift(-1)) — pass a view with the righthorizonfor multi-period targets. Prediction dates whose realized cross-section is entirely unrealized (the horizon tail) are dropped, as in the drivers.- Parameters:
entries – The competitors (see
ComparisonEntry).test_assets – The common realized-return panel — a
(date x asset)DataFrame (horizon-1 convention) or a view exposingreturns_frame()(its own horizon).evaluators – Evaluators to run on each entry’s
PricingOutput. Defaults to the native pricing pair.data_vintage – Provenance stamp copied into every result row.
- Returns:
A single tidy DataFrame in the result schema (
method= each entry’s name), validated against