Skip to content

Metrics pipelines

Answers

How is each metric computed — aggregation order, inference SE machinery. For applicability gates and sample thresholds, see Metric applicability. For output schema and metadata keys, see Stat keys by metric. For the research-question → metric mapping, see Choosing a metric.

Cross-module index of every module under factrix/metrics/. Use this page to pick the existing aggregation pattern a new metric should match, or to mechanically check that a candidate metric satisfies the Newey-West (NW) heteroskedasticity-and-autocorrelation-consistent (HAC) discipline the rest of the suite follows.

The matrix lists all metric modules — both the metrics evaluate() runs for each cell (ic, fm_beta, caar, common_beta) and the standalone helpers users can call directly on their declared input shape (quantile, monotonicity, tradability, clustering, corrado, …). The list_metrics runtime API exposes the same public spec set as a family-grouped catalog.

The table below is auto-generated from the public MetricSpec registry. It surfaces the three columns most relevant to understanding calculation logic: which factor type the module applies to, how it aggregates, and what inference procedure it uses. For the full function list and internal primitives, click the module link to the source.

Aggregation vocabulary

The agg_order column uses one canonical lowercase-hyphen form across the matrix and every metric's registered aggregation metadata:

  • cs-first — aggregate cross-section per date first, then aggregate the resulting time series. Pairs with the Guides § Aggregation order cross-section first prose.
  • ts-first — aggregate time-series per asset first, then aggregate across assets. Pairs with the time-series first prose.
  • ts-only — single-series time-series operation; no cross-section step.
  • static-cs — single cross-section, no time-axis aggregation.
  • per-event — aggregation centred on event dates (per-event-date step), then cross-event aggregation.

Matrix

Module Cell scope Aggregation order
metrics.caar (*, SPARSE, *) event_time
metrics.clustering_hhi (*, SPARSE, PANEL) cs_snapshot
metrics.common_asymmetry (COMMON, DENSE, PANEL) cs_then_ts
metrics.common_beta (COMMON, DENSE, PANEL) ts_then_cs
metrics.common_quantile (COMMON, DENSE, PANEL) cs_then_ts
metrics.concentration (INDIVIDUAL, DENSE, PANEL) cs_then_ts
metrics.corrado_rank (*, SPARSE, *) event_time
metrics.directional_hit_rate (*, DENSE, *) ts_only
metrics.directional_pair_accuracy (INDIVIDUAL, DENSE, PANEL) cs_then_ts
metrics.event_horizon (*, SPARSE, *) event_time
metrics.event_quality (*, SPARSE, *) event_time
metrics.fm_beta (INDIVIDUAL, DENSE, PANEL) cs_then_ts
metrics.ic (INDIVIDUAL, DENSE, PANEL) cs_then_ts
metrics.k_spread (INDIVIDUAL, DENSE, PANEL) cs_then_ts
metrics.mfe_mae (*, SPARSE, *) event_time
metrics.monotonicity (INDIVIDUAL, DENSE, PANEL) cs_then_ts
metrics.oos_decay (INDIVIDUAL, DENSE, PANEL) ts_only
metrics.positive_rate (INDIVIDUAL, DENSE, PANEL) ts_only
metrics.predictive_beta (*, DENSE, TIMESERIES) ts_only
metrics.quantile (INDIVIDUAL, DENSE, PANEL) cs_then_ts
metrics.spanning factor-return-series consumer (post-PANEL pipeline) ts_only
metrics.tradability (INDIVIDUAL, DENSE, PANEL) cs_then_ts
metrics.tradability (INDIVIDUAL, DENSE, PANEL) ts_only
metrics.trend (INDIVIDUAL, DENSE, PANEL) ts_only

For per-module formula derivations, read each module's top-level docstring (linked above); for the underlying paper references and inference-SE rationale, see Statistical methods; for n_obs / n_assets thresholds per metric, see Metric applicability. For the runtime API that returns the same public specs grouped by family, see list_metrics.