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, fama_macbeth, caar, ts_beta; see the
evaluate-metric table)
and the standalone helpers the user calls directly on a FactorProfile
(quantile, monotonicity, tradability, clustering, corrado, …).
The list_metrics runtime API filters this same
data to the standalone subset by (scope, signal).
The table below is auto-generated from Matrix-row: tags in each module's
docstring. 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, every Matrix-row: tag in factrix/metrics/*.py, and the
list_metrics() JSON output:
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 | Inference SE |
|---|---|---|---|
metrics.caar |
(*, SPARSE, *, PANEL) |
per-event | non-overlapping t / z |
metrics.clustering |
(*, SPARSE, *, PANEL) |
static-cs | no formal H₀ |
metrics.concentration |
(INDIVIDUAL, CONTINUOUS, *, PANEL) |
cs-first | across-time t (one-sided H₀: ratio ≥ 0.5) |
metrics.corrado |
(*, SPARSE, *, PANEL) |
per-event | nonparametric rank |
metrics.event_horizon |
(*, SPARSE, *, PANEL) |
per-event | binomial |
metrics.event_quality |
(*, SPARSE, *, PANEL) |
per-event | binomial / nonparametric rank |
metrics.fama_macbeth |
(INDIVIDUAL, CONTINUOUS, FM, PANEL) |
cs-first | NW HAC / clustered t |
metrics.hit_rate |
(*, CONTINUOUS, *, TIMESERIES) |
ts-only | binomial |
metrics.ic |
(INDIVIDUAL, CONTINUOUS, IC, PANEL) |
cs-first | NW HAC / cross-asset t |
metrics.mfe_mae |
(*, SPARSE, *, PANEL) |
per-event | no formal H₀ |
metrics.monotonicity |
(INDIVIDUAL, CONTINUOUS, *, PANEL) |
cs-first | cross-asset t |
metrics.oos |
(*, CONTINUOUS, *, TIMESERIES) |
ts-only | no formal H₀ |
metrics.quantile |
(INDIVIDUAL, CONTINUOUS, *, PANEL) |
cs-first | cross-asset t |
metrics.spanning |
factor-return-series consumer (post-PANEL pipeline) |
ts-only | NW HAC / OLS t |
metrics.tradability |
(INDIVIDUAL, CONTINUOUS, *, PANEL) |
cs-first | no formal H₀ |
metrics.tradability |
(INDIVIDUAL, CONTINUOUS, *, PANEL) |
ts-only (rank autocorrelation across consecutive dates) | no formal H₀ |
metrics.trend |
(*, CONTINUOUS, *, TIMESERIES) |
ts-only | Theil-Sen rank-based CI |
metrics.ts_asymmetry |
(COMMON, CONTINUOUS, *, PANEL) |
cs-first | NW HAC Wald |
metrics.ts_beta |
(COMMON, CONTINUOUS, *, PANEL) |
ts-first | cross-asset t |
metrics.ts_quantile |
(COMMON, CONTINUOUS, *, PANEL) |
cs-first | NW HAC Wald |
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 data filtered by (scope, signal), see
list_metrics.