Cluster Analysis on Time Series Data for Indonesian Stock Prices Using Dynamic Time Warping - Wisnowan Hendy Saputra; Nuruddeen Shehu (Jurusan Matematika FMIPA Universitas Pattimura, 2026)
This study investigates the application of the Dynamic Time Warping (DTW) algorithm to cluster the ten stocks with the largest market capitalization on the Indonesia Stock Exchange as of February 2026. Unlike conventional distance metrics, DTW handles time lag nonlinearly to identify hidden temporal pattern similarities. Adjusted closing price data was obtained through web scraping from Yahoo Finance using the R programming language. The clustering procedure was performed using Ward's Hierarchical Agglomerative Clustering method, where the number of clusters was evaluated through Silhouette coefficient analysis and qualitative economic interpretability. While the highest Silhouette score suggested two clusters, a three-cluster solution was selected as the most representative structure to better capture the granular dynamics of different market sectors. The first cluster is dominated by the banking and energy sectors with stable growth trends. The second cluster includes cyclical industrial and infrastructure stocks with high volatility. The third cluster uniquely unites GOTO and UNVR stocks in a long-term bearish downward pattern, despite their origins in different sectors. These findings demonstrate that DTW is highly effective in uncovering cross-sector market dynamics, providing a more accurate basis for portfolio diversification strategies than traditional business sector classifications.