Topology
TDA for Time Series: Takens Embedding and Financial Crashes
Цели урока
- Understand Takens theorem and delay embedding of scalar series
- Master sliding window TDA for non-stationary signals
- Study persistent entropy as a scalar measure of topological complexity
- Learn topological early warnings of critical transitions
- Cover applications to ECG, financial markets and climate
Предварительные знания
- Persistent homology and Vietoris-Rips complex
- Basic dynamical systems (attractors, bifurcations)
- Linear algebra over a field
- Basic probability concepts (autocorrelation, variance)
1987. Black Monday. Dow Jones -22.6%. Market topology simplified one month earlier. TDA saw the signal no one heard.
- **Cardiology**: arrhythmia classification via TDA features of ECG (Pereira & de Mello 2015)
- **Finance**: early warning of market crashes via persistent entropy (Gidea & Katz 2018)
- **Climate science**: El Nino cycle analysis via sliding window TDA (Berwald & Gidea 2014)
- **Industrial IoT**: equipment failure prediction via sensor data topology (Ayasdi)
From Takens to topological time series
Floris Takens proved his embedding theorem in 1981 in the paper Detecting Strange Attractors in Turbulence - a landmark paper of dynamical systems theory. The connection to TDA came much later: Perea and Harer (2015) established theoretical persistence guarantees for sliding windows of periodic signals. Gidea and Katz (2018) demonstrated topological early warnings on financial data. The first major commercial application of TDA to time series was Ayasdi work on industrial equipment sensor data. Today TDA for time series is a standard tool in risk management and medical diagnostics.
Takens Embedding Theorem
October 19, 1987. The Dow Jones fell 22.6% in a single day - the largest one-day percentage drop in history. 2008, Lehman Brothers. In both cases researchers later found that topological complexity of market correlation networks dropped sharply BEFORE the crash. Features merged, loops disappeared - market topology became simpler as the crash approached. The mathematical tool that detects these early warning signs is Takens embedding, which turns a single 1D time series into a point cloud in high-dimensional space where TDA can work.
Takens theorem (1981): for generic smooth dynamical systems, delay embedding of dimension d >= 2*dim(attractor) + 1 preserves a diffeomorphic image of the attractor. Attractor topology is recoverable from a single scalar measurement.
Choosing delay and dimension parameters
Standard heuristics from nonlinear dynamics practice
Delay tau: first minimum of the mutual information function I(x(t); x(t-tau)). This heuristic balances coordinate independence with dynamics preservation. Embedding dimension d: false nearest neighbors method - grow d until neighbors in R^d remain neighbors in R^(d+1). When the fraction of false neighbors drops to zero, the correct dimension is found.
A single sensor measures one quantity - e.g., an ECG. But cardiac dynamics is multidimensional (chambers, valves, nervous system). Takens embedding lets us recover this multidimensional dynamics from a single measurement channel.
ML applications: ECG classification through topological features of delay embedding; arrhythmia detection through analysis of loops in H_1 of the embedding; industrial vibration monitoring - specific topological patterns in the delay embedding predict bearing failure hours before it happens.
What does Takens theorem guarantee?
Takens theorem (1981) gives topological reconstruction of the attractor from a scalar measurement when d >= 2*dim(attractor)+1.
Sliding Window Persistence
Apply Takens embedding to a sliding window of length L at time t: W_t = {v_s : t <= s <= t+L}. For each window compute Vietoris-Rips persistence (usually H_1 is most informative). Track how persistence diagrams change over time. Key observation: for periodic signals the sliding window generates a circle in embedding space, and H_1 contains one long-lived feature.
Perea and Harer (2015) proved theoretical guarantees: for approximately periodic signals a long bar in H_1 persistence of the sliding window corresponds to periodicity, and its length is tied to the amplitude of the periodic component.
Persistent entropy
Scalar measure of persistence diagram complexity
Given persistence diagram D with bars of lengths l_1, ..., l_n. Normalize: p_i = l_i / sum(l_j). Persistent entropy: PE = -sum(p_i * log(p_i)). Low entropy = one dominant feature (simple topology). High entropy = many comparable-length bars (complex topology). This scalar statistic works as a feature for LSTM or Random Forest.
L must be at least the period of relevant dynamics, but small enough to capture local changes. Rule of thumb: L equals 1-3 periods of the dominant signal frequency.
Sliding window works where the signal is non-stationary - this is what makes it useful. Standard methods (FFT, ARIMA) require stationarity or an approximation thereof. Sliding window TDA tracks topology locally.
ML applications: sliding window persistent entropy as a feature for LSTM in time series classification; replacement or augmentation of traditional features (autocorrelation, STL decomposition) with topological statistics; multivariate sensor anomaly detection through comparison of persistence diagrams between adjacent windows.
What does a sliding window generate for a periodic signal?
Periodicity manifests as a circle in the delay embedding, and H_1 contains one long-lived bar.
Early Warning Signals for Critical Transitions
Near a bifurcation (tipping point), dynamical systems slow down - recovery from perturbations takes longer. This manifests as critical slowing down: autocorrelation approaches 1, variance grows. TDA adds another early warning dimension - the attractor topology changes as the system approaches the tipping point. Metric: persistent entropy of sliding windows over time.
Gidea and Katz (2018) showed topological early warnings for the 2007-2008 financial crisis: SP500 correlations persistent entropy dropped months before the collapse. Market topology became simpler, which in hindsight signaled loss of stability.
Black Monday 1987
Topological dynamics before and after the crash
A month before October 19, 1987: persistent entropy of the SP500 correlation network steadily declines. Features (H_0 clusters, H_1 cycles of correlations) merge - the market becomes topologically simpler, effectively one-dimensional. After the crash: persistent entropy spikes - topology fragments into chaos. This pattern repeated in 2000 (dot-com), 2008 (Lehman), 2020 (COVID).
In hedge fund risk management: sliding window persistent entropy of all instrument correlation pairs is tracked in real time. Entropy drop below a historical threshold triggers leverage reduction and position review.
Persistent entropy is one early warning signal, not a silver bullet. The best approaches combine critical slowing down (variance, autocorrelation), TDA metrics (entropy, longest bar) and domain indicators (VIX, spreads). False positives are inevitable - topology can change for benign reasons.
Other applications: ecological tipping points (lake eutrophication - species interaction network topology simplifies before ecosystem collapse); climate tipping points (Berwald and Gidea 2014 on El Nino patterns); ML model health monitoring in production - output distribution topology changes under concept drift, a prerequisite for retraining.
What happens to persistent entropy as the tipping point approaches?
Critical slowing down also manifests in topology: the system loses configuration diversity before the bifurcation.
Applications: ECG, Markets, Climate
ECG analysis: atrial fibrillation produces distinctive topological patterns in Takens embedding - loops appear that are absent in normal rhythm. Pereira and de Mello (2015) published arrhythmia classification with TDA features achieving 92-95% accuracy on standard datasets (MIT-BIH Arrhythmia).
Sliding window TDA on ECG has a physiological interpretation: H_1 bars measure regularity of the cardiac cycle, the number of H_0 components - rhythmic variability. Arrhythmias disrupt both characteristics in predictable ways.
2008 financial catastrophe
Gidea-Katz, Topological Data Analysis of Financial Time Series
Method: daily SP500 returns over 100 days, sliding window delay embedding, H_0 and H_1 persistence via VR. Metric: L1, L2 norms of persistence diagrams over time. Result: the norm spikes in August 2008, a month before Lehman Brothers bankruptcy. The same pattern appears before dot-com (2000), Asian crisis (1997), 1987 - validation across four crash episodes in hindsight.
Current frontier: time series transformers + TDA features. TDA provides global topological invariants, the transformer handles local patterns via self-attention. The hybrid outperforms pure neural approaches on time series classification, especially when training data is scarce.
Climate: Berwald and Gidea (2014) applied sliding window TDA to Pacific Ocean temperature series for analyzing El Nino cycles. Topological features revealed decade-scale changes in cycle stability. Industry: Ayasdi (one of the first TDA companies) applied the method to industrial equipment sensor data - predicting turbine and pump failures days before breakdown.
Hyperparameter tuning (tau, d, L) remains a manual process - no universal heuristics for every task. Differentiable TDA (learnable filtration parameters via gradient descent) is an active research area, but computationally expensive.
How does the ML hybrid of TDA with neural networks beat each one separately?
TDA and neural networks complement each other: topology gives robustness and interpretability, networks give flexibility and accuracy.
Where this leads
Sliding window TDA bridges differential geometry (Takens) with computational topology (persistence) and applications in finance, medicine and climatology. It is one of the most powerful applications of topology outside pure mathematics.
- TDA in neural networks — Related topic
- Witness complexes — Related topic
- Persistent homology — Related topic
- Vietoris-Rips and Cech — Related topic
Key ideas
- Takens embedding turns a scalar signal into a d-dimensional point cloud via delay vectors
- For d >= 2*dim(attractor)+1 attractor topology is preserved (Takens 1981)
- Parameters tau and d are chosen via mutual information and false nearest neighbors
- Sliding window persistence tracks topology locally in time
- Periodic signals give a circle in embedding with a long H_1 bar
- Persistent entropy is a scalar diagram complexity measure, useful as an ML feature
- Critical slowing down has a topological analog: simplification before the tipping point
- Applications: ECG classification, financial crash prediction, climate tipping points
Вопросы для размышления
- Why does Takens theorem require d >= 2*dim(attractor)+1 and not just dim(attractor)?
- What properties of financial data make TDA a fitting tool, unlike classical econometrics?
- How does window size L choice affect sensitivity to different time scales?
- In which tasks is persistent entropy preferable to a full persistence diagram?
- How to learn delay embedding parameters via gradient descent without losing theoretical guarantees?
Связанные уроки
- top-32 — Persistence is needed for sliding window analysis
- top-35 — Witness complexes scale sliding window TDA
- top-37 — Neural activations are also time series for TDA
- prob-18-poisson