Abstract
Traditional portfolio diversification relies on categorical industry sectors that often fail to capture the complex, non-linear dependencies of modern financial markets. This paper introduces a novel two-stage framework for stock selection that replaces industry-sector diversification with clustering based on Topological Data Analysis (TDA). By treating stock price movements as high-dimensional geometric structures, the proposed method identifies hidden relationships between assets. Empirical results using S&P 500 data demonstrate that TDA-based embeddings consistently produce lower-risk portfolios that outperform traditional benchmarks and modern machine learning baselines across diverse market regimes.
Introduction
Effective portfolio management is predicated on the principle of diversification—the strategic allocation of assets to mitigate unsystematic risk. Historically, investors have achieved this by selecting stocks across different Global Industry Classification Standard (GICS) sectors, such as Energy, Technology, and Healthcare. However, these labels are increasingly becoming abstractions that do not reflect actual market behavior. For example, a company like Amazon is classified under "Consumer Discretionary" but often exhibits the price volatility and correlation patterns of a "Technology" stock.
Standard statistical methods, including linear correlation, frequently fail to capture the intricate dependencies inherent in financial time series. While deep learning architectures like LSTMs and Transformers have been applied to financial forecasting, they often struggle with the high signal-to-noise ratio of market data. This research addresses these challenges by leveraging TDA to represent stock behavior as robust topological "shapes," allowing for a more mathematically grounded approach to diversification.
Methodology
The authors propose a four-step pipeline designed to extract and utilize topological features for portfolio construction:
1. Embedding Generation
The core innovation lies in the transformation of raw 1D price series into high-dimensional point clouds using Time Delay Embeddings. From these clouds, the framework applies TDA to generate Persistence Barcodes, which track the birth and death of topological features (such as loops or voids) across multiple scales. To integrate these features into a machine learning workflow, the barcodes are vectorized into Persistence Images (PI) and Persistence Landscapes (PL).
2. Topological Clustering
Rather than relying on industry labels, the model clusters stocks based on their TDA embeddings. The authors utilize K-Means and Agglomerative clustering, fixing the number of clusters at 11 to maintain parity with the 11 standard GICS economic sectors. This allows for a direct comparison between topological diversification and traditional sector diversification.
3. Stock Selection
From each of the 11 topological clusters, the two stocks with the highest Sharpe ratio during the training period are selected. This results in a concentrated 22-stock portfolio designed to capture the best risk-adjusted performers within each distinct topological regime.
4. Backtesting and Optimization
The resulting portfolio is evaluated using a Markowitz mean-variance optimization model with monthly rebalancing. The performance is benchmarked against raw economic sectors, classical financial features (e.g., Value at Risk), LSTM-based autoencoders, and Transformer-based embeddings (Signal2Vec).
Experimental Setup and Datasets
The study utilizes historical market data from the S&P 500 index. To ensure the robustness of the findings across different market cycles—including periods of growth and extreme volatility—the authors tested the framework across three distinct windows:
- USA 2012: Training (2012–2013), Testing (2014–2017)
- USA 2015: Training (2015–2016), Testing (2017–2019)
- USA 2018: Training (2018–2019), Testing (2020–2022)
These periods encompass various macro-economic shifts, including the onset of the COVID-19 pandemic, providing a rigorous test for the stability of TDA-based features.
Key Insights and Results
The Geometry of Market Cycles
The research suggests that economic cycles manifest as specific topological structures in high-dimensional space. TDA is uniquely capable of identifying these cycles where traditional correlation-based methods perceive only noise. The study found that Persistence Images (PI) were particularly effective, outperforming Persistence Landscapes due to their superior stability and resistance to the inherent noise of financial data.
Risk Reduction and Performance
The TDA-based approach (specifically the PI1 embedding) achieved the lowest risk among all clustering baselines in the 2015–2019 and 2018–2022 test periods. Notably, in the 2015–2019 window, the TDA portfolio was one of the few methods to successfully reduce risk through diversification, even outperforming the S&P 500 index in terms of cumulative growth.
Consistency Across Regimes
While neural network models like Transformers occasionally produced high Sharpe ratios, their performance was inconsistent across different time windows. In contrast, the TDA framework demonstrated remarkable stability. By selecting only 22 stocks based on topological independence, the model achieved risk levels comparable to or lower than the full 500-stock index, proving the efficiency of topological diversification.
Conclusion and Future Work
This paper demonstrates that Topological Data Analysis provides a powerful alternative to traditional sector-based portfolio management. By identifying stocks that are mathematically rather than categorically independent, the TDA framework offers a robust defense against market volatility.
Future research may explore the dynamic optimization of cluster counts rather than adhering to the fixed GICS count of 11. Additionally, while this study focused on large-cap U.S. equities, applying TDA to more volatile asset classes, such as small-cap stocks or cryptocurrencies, remains a promising area for further investigation. Despite the higher computational intensity of TDA compared to standard clustering, its ability to capture the "shape" of market data offers a significant advantage for risk-averse investors.
Summary updated