?
A Clustering Model for Stocks that Considers Hidden Dynamics and Price Trajectory
One of the main tools for analyzing large volumes of financial data is the use of clustering methods and models, which allow the identification of various patterns. This study examines the problem of clustering time series that reflect the behavior of prices, yields, modes, trends, and a number of related stock indicators. The relevance and novelty of the study lies in the fact that original algorithms for clustering stocks are proposed, which consist of combining two approaches: probabilistic modeling of time series using Hidden Markov Models (HMM) and metric alignment of time series through Dynamic Time Warping (DTW). We evaluated the results using clustering quality metrics, the Silhouette coefficient, the Davis-Bouldin index, and investment efficiency metrics, including the Sharpe and Omega ratios. Using these results, we performed a comparative analysis of the proposed and classical clustering models and demonstrated the superior performance of the proposed approach. To analyze the universality of the proposed algorithms, we used stock data from two indices representing vastly different markets, a developed market and a developing market, both during a crisis period. The time interval of this study covers the last ten years (2015 - 2025).