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_view and prices the shared test assets through its test_view (defaulting to train_view); realized returns always come from the canonical test_assets panel, 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 PricingOutput invariant): predicted.loc[t] prices the return realized over (t, t+h], exactly as in the pricing drivers. When test_assets is 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 right horizon for 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 exposing returns_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

  • RESULT_COLUMNS.