← Back to projects
05 / 05 Applied topology · Finance Planned

TDA on financial time series
Regime change detection

Use persistent homology over sliding windows of multi-asset returns to detect transitions between normal regime and market crises (2008, 2011, 2015, 2020). Topological descriptors feed a supervised classifier.

// Overview

About this project

Classical methods for detecting regime changes in finance (rolling volatility, rolling correlations, HMMs) look at statistical moments. Topological Data Analysis proposes a complementary angle: look at the shape of the return cloud in ℝd through persistent homology, extracting invariants that are robust to reparameterization.

Idea: in a normal regime, returns form a "round" low-correlation cloud; during a crisis, the cloud collapses toward a single direction (systemic co-movement) and its topology changes. Persistence bars detect that change earlier than traditional aggregate metrics.

This project uses training in algebraic topology — a tool no other junior ML engineer will have — on a financial problem with real impact.

Mathematical pipeline

Log returns:

rt = log(pt / pt−1) ∈ ℝd

Sliding window:

Wt = {rs : t − h ≤ s ≤ t} ⊂ ℝd

Vietoris-Rips persistent homology:

PD0(Wt), PD1(Wt)

Features:

φ(Wt) = [entropy, landscape, # components, max persistence]
// Skills demonstrated

What skills it certifies

Applied algebraic topology
Vietoris-Rips persistent homology computation in dimensions 0 and 1 over point clouds.
Exotic feature engineering
Convert persistence diagrams into vectors (persistence landscapes, entropy, images) as input to classical ML.
Time series
Sliding windows, temporal alignment, handling missing ticks and holidays.
Quantitative finance
Log returns, realized volatility, rolling correlations as comparison baselines.
Classical ML
Random Forest / SVM over topological features with temporal cross-validation (walk-forward).
Domain validation
Confirm score peaks coincide with real macro events (Lehman 2008, COVID 2020).
Visual storytelling
Before / during / after crisis plots with annotated persistence diagrams.
Python Giotto-TDA Ripser NumPy Pandas scikit-learn yfinance Matplotlib Persistence Homology
// Structure

Project organization

05-tda-finance/
├── README.md
├── requirements.txt
├── src/
│   ├── data.py          # download prices and compute log returns
│   ├── persistence.py   # persistent homology over sliding windows
│   ├── features.py      # persistence landscapes / images / entropy
│   └── classify.py      # supervised classifier normal vs. crisis
└── notebooks/        # historical analysis + visualizations
// Roadmap

Project status

// Metrics

Success criteria

Classification

ROC-AUC > 0.85 separating normal regime from crisis.

Outperforms realized volatility baseline.

Interpretability

Temporal peaks of the "topological anomaly score" coinciding with:

subprime 2008 · European default 2011 · China selloff 2015 · COVID 2020.

// Results

Outputs and final metrics

Temporal score with macro events, persistence diagrams, and classifier metrics.

Pending

No results published yet.

What goes here: "topological anomaly score" time series with annotated crises, persistence diagrams across regimes, confusion matrix, and classifier AUC.