r/quant•
devilldog

[Project] Applying Lie Algebra to Covariance Matrices: A Two-Signal Market Regime Detector (33/33 Market-Event Pairs, 0.8 FP/Year)

Models

I've been working on a framework that uses Lie Algebra (commutators) to detect structural breaks in financial markets, and wanted to share it with the community. After extensive validation across 33 market-event pairs spanning 2000-2024, the two-signal system achieves 100% detection on pre-specified institutional stress episodes across 8 asset classes.

On false positives: The system triggers ~0.8 false positives per year per market (vs. 2.3/year for Lambda-F alone, 4.5/year for rolling volatility). Pre-specified events are macro/institutional stress episodes; exogenous "no-precursor" shocks are excluded by design (see Black Swan section).

The Theory

Instead of looking at price velocity (standard volatility/GARCH), I model the market as a path through the manifold of covariance matrices. I measure two things:

  1. Lambda-F (Rotation): The "curvature" of the covariance path using the matrix commutator. Detects when institutions rotate between factors (dumping momentum, piling into defensives).
  2. Correlation Spike (Synchronization): Average pairwise correlation across factors. Detects when everything sells together (panic/de-risking).

Think of it this way:

  • Volatility tells you how fast the car is going
  • Lambda-F tells you the steering wheel is jerking (rotation)
  • Correlation tells you all cars on the highway are swerving the same direction (synchronized panic)

Why Two Signals?

Lambda-F alone missed some events. When I analyzed the failures, a clear pattern emerged:

MissLambda-FTypeProblem
US Q4 201861%Fed panicAll sectors sold together—no rotation
UK Mini-budget48%Fiscal shockGilts/equities/GBP all crashed at once
Germany Energy50%Supply shockEverything correlated with gas prices

The insight: Lambda-F detects rotation (sectors moving differently). But synchronized selloffs (everything down together) have HIGH correlation and LOW rotation. Adding correlation catches these.

Full Validation: 33/33 Market-Event Pairs

Events are pre-specified macro/institutional stress episodes (>20% drawdown or major regime shift). The same global episode (e.g., GFC, 2011 Eurozone) appears across multiple markets.

Equities (10 pairs)

MarketEventLambda-FCorrelationCaught By
US EquityDot-Com 200075% ✓—λ
US EquityGFC 200886.5% ✓—λ
US EquityQ4 201861%96.7% ✓ρ
US Equity2022 Bear91% ✓—λ
UK EquityQ4 201888% ✓—λ
UK EquityMini-budget 202248%98.7% ✓ρ
UK Equity2011 Eurozone99.9% ✓99.1% ✓λ+ρ
GermanyQ4 201887% ✓—λ
GermanyEnergy Crisis 202250%98.4% ✓ρ
Germany2011 Eurozone99.4% ✓100% ✓λ+ρ

Commodities & Gold (6 pairs)

MarketEventLambda-FCorrelationCaught By
CommoditiesQ4 201894% ✓—λ
CommoditiesWTI Negative 202089% ✓—λ
CommoditiesUkraine 202292% ✓—λ
Commodities2014-16 Oil Bust96.7% ✓81%λ
GoldQ4 201885% ✓—λ
Gold$2000 Breakout91% ✓—λ

Crypto (3 pairs)

MarketEventLambda-FCorrelationCaught By
CryptoApril 2021 Top88% ✓—λ
CryptoNov 2021 Top92% ✓—λ
CryptoMarch 2024 Top81% ✓—λ

Bonds (6 pairs) — NEW

MarketEventLambda-FCorrelationCaught By
BondsGFC 200895% ✓88%λ
BondsTaper Tantrum 201397% ✓100% ✓λ+ρ
BondsTreasury Stress 202086% ✓—λ
BondsBond Crash 202297% ✓100% ✓λ+ρ
BondsSVB Crisis 2023100% ✓100% ✓λ+ρ
BondsOct Spike 202388% ✓100% ✓λ+ρ

Emerging Markets (8 pairs) — NEW

MarketEventLambda-FCorrelationCaught By
EMGFC 200895% ✓98% ✓λ+ρ
EMEM Selloff 2011100% ✓100% ✓λ+ρ
EMTaper Tantrum 2013100% ✓77%λ
EMChina Deval 201596% ✓—λ
EMEM Crisis 201697% ✓84%λ
EMEM Rout 201899% ✓—λ
EMCOVID Flight 202085% ✓100% ✓λ+ρ
EMChina Reopen 202293% ✓—λ

Detection breakdown:

  • Lambda-F only: 21 pairs (64%) — factor rotation
  • Correlation only: 3 pairs (9%) — synchronized selloff
  • Both signals: 9 pairs (27%) — maximum stress

Key Findings

Dot-Com 2000: Extended validation back to 2000. Lambda-F hit 75th percentile with 43-day lead time—exactly at threshold. Framework now spans 25 years.

GFC 2008: Lambda-F peaked August 9-13, 2007 (86.5th percentile) with 57-day lead time before the S&P 500 top. The peak coincided exactly with BNP Paribas freezing three subprime funds.

2011 Eurozone Crisis: Both signals hit 99%+. Germany correlation reached 100th percentile—maximum synchronization. This was true panic with both institutional rotation AND synchronized selling.

2014-2016 Oil Bust: Lambda-F caught it (96.7%, 115 days elevated) but correlation did NOT spike (81%). This was a slow 18-month rotation, not a panic.

SVB Crisis 2023: Both signals hit 100th percentile in bonds—maximum stress. Detected the duration mismatch crisis and flight to short-duration assets.

EM Taper Tantrum 2013: Lambda-F hit 100% with 22 days elevated as institutional capital fled emerging markets on Fed tightening signals.

Black Swan Handling

Excluded for Developed Markets (correct non-detection):

  • COVID-19 (pandemic—no institutional precursor)
  • Terra/Luna (algorithmic failure)
  • 3AC/Celsius (counterparty contagion)
  • FTX (fraud)

COVID for Emerging Markets: DETECTED (correctly)

This is interesting—COVID is classified differently by market. For developed markets, it was a synchronized exogenous shock (no rotation signal). But for EM, the framework correctly detected genuine institutional capital flight from emerging to developed markets. That's a real rotation, not just a shock.

Walk-Forward Validation (No Look-Ahead Bias)

Parameters tuned only on historical data, then tested on future events:

CycleTraining DataPeak SignalResult
20172015-201623%Not Classified (pre-institutional)
20212015-202092%Classified (31 days lead)
20252015-202477%Classified

The 2017 miss is expected: CME Bitcoin futures launched Dec 17, 2017—literally the day of the top. No institutional infrastructure existed.

Independent Academic Validation

Three recent papers validate the underlying mechanics:

  1. Soleimani (2025) [arXiv:2512.07886]: Confirms regime-switching at 90th percentile thresholds
  2. Tang et al. (2025) [arXiv:2402.11930]: Documents structural breaks in Bitcoin microstructure around 2020
  3. Borri et al. (2025) [arXiv:2510.14435]: Yale/Rochester/Berkeley team validates factor models + funding rate predictability

The Live Signal (Why I'm Posting)

Current dashboard (2026-01-06):

MarketLambda-FL PctlElevCorrC PctlRegime
Commodities3.5794%14d*0.2678%CRITICAL (L)
Gold3.5478%6d*0.2358%CRITICAL (L)
Crypto (BTC)3.3976%2d0.8161%Normal
US Equity (SPY)3.5268%--0.3324%Normal
UK Equity (EWU)3.3453%--0.498%Normal
Germany (EWG)3.1525%6d0.3711%ELEVATED (L)
Bonds3.2634%8d0.7663%ELEVATED (L)
Emerging Markets2.844%--0.3116%Normal

*Elevated days in trailing 30-day window that triggered regime

Live Dashboard: github.com/vonlambda/lambda-f-dashboard

Commodities and Gold in CRITICAL while equities remain Normal. Germany and Bonds ELEVATED. Classic risk-off rotation pattern—capital flowing from risk assets into hard assets/defensives.

False Positive Comparison

MethodDetection RateFP/YearPrecisionAvg Lead Time
Two-Signal (this)100%0.879%22 days
Lambda-F only91%2.357%22 days
Correlation only36%1.141%8 days
Rolling Vol > P9067%4.522%6 days

The two-signal system isn't just catching more—it's catching more with fewer false alarms. The correlation signal acts as a second path to detection, not a lower bar.

Technical Summary

SignalMeasuresCatches
Lambda-FCommutator ‖[F, Ḟ]‖Factor rotation (slow or fast)
CorrelationAvg pairwise ρSynchronized selloffs
CombinedEither elevatedAll institutional events

Classification:

  • λ ≥ P75 → ELEVATED (rotation)
  • ρ ≥ P90 → ELEVATED (sync)
  • Either ≥ P90 → CRITICAL
  • Both elevated → CRITICAL+ (maximum stress)

Questions for r/quant

  1. Factor model improvements: Using sector ETFs for equities. Would Fama-French or PCA factors improve rotation detection?
  2. Bonds factors: Currently using duration spectrum (SHY/IEF/TLT) + credit (LQD/HYG) + inflation (TIP). Better factor decomposition?
  3. EM correlation with Commodities: EM-Commodities Lambda signal correlation is only 0.29—independent enough to justify separate tracking?
  4. Signal weighting: Lambda-F leads by 30-60 days. Correlation confirms during event. How would you combine them for a single score?

Paper & Code: Full methodology available on request. Dashboard updates daily.

Disclaimer: Research, not financial advice. Posting to see if others track similar structural stress patterns.

Posted Jan 6, 2026, 2:59 PM UTC

1912

Comments aren't archived yet

This post had 12 comments on Reddit. Comments for this period haven't been loaded into the archive yet.