Skip to content

Methodology

This page explains the math behind the toolkit at a level a competent quant can verify. Phase 0 ships only the schema contracts; the implementations referenced below land in later phases.

Correlation networks

  • Returns are computed as log returns over the configured bar resolution (default 15 minutes). Prices are never used directly.
  • Pairwise correlation is computed over a configurable rolling window (default 24 hours). Correlations below the configured edge threshold (default 0.4) are dropped; the resulting graph is the input to community detection.
  • Community detection uses Louvain modularity maximisation with a fixed random seed for reproducibility.

Lead-lag analysis

  • Lagged cross-correlation is computed across the configured set of bar lags (default [1, 2, 4, 8, 16] bars).
  • Stationarity of each return series is verified with an Augmented Dickey-Fuller (ADF) test before any Granger causality test is run. Non-stationary series are excluded from the lead-lag analysis.
  • Granger causality is tested for each ordered pair using the standard F-test. P-values are corrected for multiple testing via the Benjamini-Hochberg procedure across the full pair set.
  • Hub scoring within a cluster is the weighted out-degree of each node in the directed lead-lag graph, where edge weights combine the lagged cross-correlation magnitude with the inverse of the corrected p-value.

Regime classification

The regime classifier is rule-based by design — operators must be able to explain why downstream signals were suppressed. Indicators feed both the discrete classification and the continuous confidence multiplier:

  • Mean pairwise correlation across the universe
  • Correlation-matrix stability (Frobenius norm of consecutive matrices)
  • Cluster persistence (Jaccard index between consecutive clusterings)
  • Universe churn (percent of universe membership that turned over)
  • Feature drift (PSI or KL divergence vs the training distribution)
  • Out-of-distribution score (Mahalanobis distance from the training centroid in indicator-feature space)

Hard-override circuit breakers force signal_status to "suppressed" regardless of model output when any of the configured thresholds are crossed. See Output E — Regime for the discrete class set and breaker definitions.

Calibrated confidence

Every signal carries a confidence field that is the product of:

  1. A base statistical confidence from the underlying relationship (Granger p-value, correlation strength, sample size, recency-weighted).
  2. A regime confidence multiplier from Output E, computed via a calibrated logistic regression trained on the validation split.

Calibration is evaluated with reliability diagrams and Brier score, not just discrimination metrics like AUC. Validation gate G7 requires the realised hit rate within each confidence bucket to fall within 10 percentage points of the predicted rate.

Validation gates

Eight gates (G1–G8) are evaluated on every backtest run; the report labels each PASS or FAIL. See memenet_network_plan.md §6 in the source repository for the full list.