Hierarchical and Dynamic Time Warping-Based Unsupervised Clustering of S&P SL20 Companies in the Colombo Stock Exchange, Sri Lanka
Ruwantha Perera1*, Dulanji Samarakoon2, Dilushika Anton Michael3, Yasmi Rajapaksha4, Kavindi Vinurika5, Gihashi Liyanage6
1,2,3,4,5,6Department of Statistics & Computer Science, Faculty of Science, University of Kelaniya, Sri Lanka
Corresponding Author Email: ruwanthap2000@gmail.com
Abstract
The Colombo Stock Exchange plays a crucial role in Sri Lanka's financial system. However, the conventional industry-based classification of S&P SL20 companies may fail to capture deeper relationships within the market. This study introduces a data-driven framework to reveal non-traditional sector groupings using Dynamic Time Warping and hierarchical clustering. Daily trading data from S&P SL20 constituents, from August 2024 to July 2025, were collected and pre-processed to derive key features including daily returns, volatility, momentum, and relative volume. Each series was normalised to ensure comparability. DTW, which aligns time series with non-linear temporal variations, was applied to capture similarities in market dynamics across companies, and agglomerative hierarchical clustering with average linkage was used to form clusters. Internal validation through Silhouette, Davies–Bouldin, and Calinski–Harabasz indices revealed robust clustering structures. A two-cluster solution denoted Richard Pieris as an outlier, while a five-cluster solution uncovered more nuanced relationships, grouping firms such as Vallibel One, Central Finance, LB Finance, and Hemas Holdings despite differing industry labels. Sampath and Commercial Banks showed strong temporal co-movements, whereas Lanka Lubricants and RCL exhibited distinctly unique behaviours. These findings imply that stock price co-movements in Sri Lanka are shaped not only by sectoral affiliation but also by broader forces such as liquidity shocks, momentum trends, and investor sentiment. By identifying hidden interconnections, this research contributes a novel perspective to Sri Lankan financial analysis and complements existing studies that focus on volatility or firm-level fundamentals. In practice, the results imply that investors can enhance Portfolio allocation and reduce risk by considering clusters of firms with similar trading dynamics rather than relying solely on Standard industry groupings.
Full Article
The complete article is available in PDF format. The PDF contains the full text of the published article.
picture_as_pdf View Full Article PDFHow to Cite
Perera, R., Samarakoon, D., Michael, D.A., Rajapaksha, Y., Vinurika, K. and Liyanage, G. (2026) ‘Hierarchical and Dynamic Time Warping-Based Unsupervised Clustering of S&P SL20 Companies in the Colombo Stock Exchange, Sri Lanka’, Journal of Eurasian Social Sciences, 1(1), pp. 67–74. https://doi.org/10.68283/jess.v1.i1.a07