Optimal Portfolio Formation Using a Combination of Genetic Algorithms and Particle Swarm Optimization Based on Cluster Analysis
DOI:
https://doi.org/10.20956/j.v22i3.50039Keywords:
GA-PSO Hybrid, Agglomerative Hierarchical Clustering, DBSCAN, K-Means, Stock PortfolioAbstract
The formation of an optimal portfolio is one of the strategies of investors in allocating their funds so as to minimize risk while maximizing profits. The optimal portfolio formation method has evolved over the years, ranging from simple calculation methods, to using complex optimization algorithms. This study aims to group LQ-45 stocks through a clustering algorithm, then determine the right weighting of representative shares of each cluster through the combination of GA-PSO so that an optimal portfolio is produced. The research begins with data pre-processing which includes transformation and reduction of data dimensions. The data from the dimension reduction is used to group stocks into clusters based on the best clustering algorithm. The stocks with the highest Sharpe ratio in each cluster are used to form the portfolio. The performance of the weighted portfolio using GA-PSO will be compared with the weighted portfolio using PSO. The results of the study showed that the K-Means algorithm became the clustering method with the highest silhouette score, which was 0.3614, and the optimal number of clusters produced was 6. Based on the results of the K-Means algorithm, the cluster representative stocks used for portfolio formation are ANTM, BRPT, EXCL, MDKA, MEDC, and PTBA. Furthermore, the results showed that the Sharpe ratio of stock portfolios using GA-PSO combined was greater than that of portfolios that used PSO alone for weighting. The K-Means algorithm is more suitable for grouping stocks than the DBSCAN and Agglomerative algorithms with Average Linkage. Furthermore, the combination of genetic algorithms and particle swarm optimization complements each other in weighting stocks so that it produces a portfolio with more optimal performance when compared to only using particle swarm optimization.
References
[1] Anam, S., Bukhori, H.A., Maulana, A., Maulana, M.I., Rasikhun, H., 2025. An Enhanced Particle Swarm Optimization with Mutation for Mean-Value-at-Risk Portfolio Optimization in the Indonesian Banking Sector. Jurnal Teknik Informatika (Jutif), Vol. 6, No. 4, 2648–2666.
[2] Ardhani, N.T., Notodiputro, K.A., Oktarina, S.D., 2025. Winsorization for Outliers in Clustering Non-Cyclical Stocks with K-Means and K-Medoids: Winsorization untuk Penanganan Pencilan dalam Penggerombolan Saham Sektor Consumer Non-Cyclical dengan K-Means dan K-Medoids. Indonesian Journal of Statistics and Its Applications, Vol. 9, No. 1, 46–60.
[3] Bacon, C.R., 2022. Practical risk-adjusted performance measurement, Second Edition. Wiley, Hoboken, NJ.
[4] Berk, J., DeMarzo, P., 2023. Corporate finance, Sixth Edition. Pearson, New York.
[5] Bulani, V., Bezbradica, M., Crane, M., 2025. Improving Portfolio Management Using Clustering and Particle Swarm Optimisation. Mathematics, Vol. 13, No. 10, 1623.
[6] De Athayde, G.M., Flôres, R.G., 2004. Finding a maximum skewness portfolio—a general solution to three-moments portfolio choice. Journal of Economic Dynamics and Control, Vol. 28, No. 7, 1335–1352.
[7] Ding, C., He, X., 2004. K -means clustering via principal component analysis. Twenty-first international conference on Machine learning - ICML ’04, 29.
[8] Ebrahimi, P., Asjodi, A.H., Dolatshahi, K.M., 2025. Quantifying hybrid failure mode in cyclic-loaded reinforced concrete shear walls: Integrating unsupervised and supervised learning techniques. Engineering Applications of Artificial Intelligence, Vol. 162, 112346.
[9] Farid, F., Rosadi, D., 2022. Portfolio optimization based on self-organizing maps clustering and genetics algorithm. International Journal of Advances in Intelligent Informatics, Vol. 8, No. 1, 33.
[10] Guttman, L., 1954. Some Necessary Conditions for Common-Factor Analysis. Psychometrika, Vol. 19, No. 2, 149–161.
[11] Holland, J.H., 1975. Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control, and artificial intelligence, University of Michigan Press, Ann Arbor.
[12] Jearanaitanakij, K., Poonpon, N., Wongtep, C., Buriyameathakul, K., Pimsupaporn, A., 2025. Stock Clustering Framework using Financial Ratios: A Case Study in the Stock Exchange of Thailand. Engineering and Technology Horizons, Vol. 42, No. 4,
[13] Jogiyanto, H., 2017. Teori Portofolio dan Analisis Investasi, Eleventh Edition. BPFE, Yogyakarta, Indonesia.
[14] Johnson, R.A., Wichern, D.W., 2019. Applied multivariate statistical analysis, Sixth Edition [Pearson modern classic edition]. Pearson, Upper Saddle River, New Jersey.
[15] Jondeau, E., Rockinger, M., 2006. Optimal Portfolio Allocation under Higher Moments. European Financial Management, Vol. 12, No. 1, 29–55.
[16] Kaiser, H.F., 1961. A Note On Guttman’s Lower Bound For The Number Of Common Factors. British Journal of Statistical Psychology, Vol. 14, No. 1, 1–2.
[17] Kennedy, J., Eberhart, R., 1995. Particle swarm optimization. Proceedings of ICNN’95 - International Conference on Neural Networks, Vol. 4, 1942–1948.
[18] Kuo, R.J., Hong, C.W., 2013. Integration of Genetic Algorithm and Particle Swarm Optimization for Investment Portfolio Optimization. Applied Mathematics & Information Sciences, Vol. 7, No. 6, 2397–2408.
[19] Leonard K., Peter J. R., 2005. Finding Groups in Data: An Introduction to Cluster Analysis, John Wiley & Sons, Inc., New Jersey, USA.
[20] Lesnussa, T.P., Utubira, E.E.M., Kaseside, M., 2025. Penerapan Metode Principal Component Analysis (Studi Kasus: Tingkat Kemiskinan di Kepulauan Maluku). Bilangan : Jurnal Ilmiah Matematika, Kebumian dan Angkasa, Vol. 3, No. 2, 172–181.
[21] Morales, E.F., Escalante, H.J., 2022. A brief introduction to supervised, unsupervised, and reinforcement learning.
[22] Naeem, S., Ali, A., Anam, S., Ahmed, M.M., 2023. An Unsupervised Machine Learning Algorithms: Comprehensive Review. International Journal of Computing and Digital Systems, Vol. 13, No. 1, 911–921.
[23] Palupi, I., Wahyudi, B.A., Indwiarti, I., 2019. The Clustering Algorithms Approach for Decision Efficiency in Investment Portfolio Diversification. 2019 7th International Conference on Information and Communication Technology (ICoICT), 1–6.
[24] Piotrowski, A.P., Napiorkowski, J.J., Piotrowska, A.E., 2020. Population size in Particle Swarm Optimization. Swarm and Evolutionary Computation, Vol. 58, 100718.
[25] Pratama, Y., Sulistianingsih, E., Debataraja, N.N., Imro’ah, N., 2024. K-Means Clustering dan Mean Variance Efficient Portfolio dalam Portofolio Saham. Jambura Journal of Probability and Statistics, Vol. 5, No. 1, 24–30.
[26] Robinson, T.R., 2015. International financial statement analysis, Third Edition. John Wiley & Sons, Hoboken, N.J.
[27] Rodriguez, M.Z., Comin, C.H., Casanova, D., Bruno, O.M., Amancio, D.R., Costa, L.D.F., Rodrigues, F.A., 2019. Clustering algorithms: A comparative approach. PLOS ONE, Vol. 14, No. 1, e0210236.
[28] Ross, S.A., Westerfield, R., Jaffe, J.F., Jordan, B.D., 2022. Corporate finance, Thirteenth Edition, international student edition Edition. MCGraw Hill, New-York NY.
[29] Rousseeuw, P.J., 1987. Silhouettes: A graphical aid to the interpretation and validation of cluster analysis. Journal of Computational and Applied Mathematics, Vol. 20, 53–65.
[30] Setiawan, E.P., Rosadi, D., 2019. Model Pengoptimuman Portofolio Mean-Variance dan Perkembangan Praktisnya. Jurnal Optimasi Sistem Industri, Vol. 18, No. 1, 8–16.
[31] Shami, T.M., El-Saleh, A.A., Alswaitti, M., Al-Tashi, Q., Summakieh, M.A., Mirjalili, S., 2022. Particle Swarm Optimization: A Comprehensive Survey. IEEE Access, Vol. 10, 10031–10061.
[32] Shi, Y., Eberhart, R., 1998. A modified particle swarm optimizer. 1998 IEEE International Conference on Evolutionary Computation Proceedings. IEEE World Congress on Computational Intelligence (Cat. No.98TH8360), 69–73.
[33] Sunariyah, 2011. Pengantar Pengetahuan Pasar Modal, Sixth Edition. UPP STIM YKPN, Yogyakarta, Indonesia.
[34] Sutramiani, N.P., Arthana, I.M.T., Lampung, P.F., Aurelia, S., Fauzi, M., Darma, I.W.A.S., 2024. The Performance Comparison of DBSCAN and K-Means Clustering for MSMEs Grouping based on Asset Value and Turnover. Journal of Information Systems Engineering and Business Intelligence, Vol. 10, No. 1, 13–24.
[35] Tandelilin, E., 2010. Portofolio dan Investasi: Teori dan Aplikasi, PT Kanisius, Sleman, Indonesia.
[36] Tang, C., Wu, H., 2022. Joint optimization of task caching and computation offloading in vehicular edge computing. Peer-to-Peer Networking and Applications, Vol. 15, No. 2, 854–869.
[37] Tomar, V., Bansal, M., Singh, P., 2024. Metaheuristic Algorithms for Optimization: A Brief Review. RAiSE-2023, 238.
[38] Wang, D., Tan, D., Liu, L., 2018. Particle swarm optimization algorithm: an overview. Soft Computing, Vol. 22, No. 2, 387–408.
[39] West, R.M., 2022. Best practice in statistics: The use of log transformation. Annals of Clinical Biochemistry: International Journal of Laboratory Medicine, Vol. 59, No. 3, 162–165.
[40] Widyaningrum, E.N., Hariyanto, H., Wahyudi, S., 2022. Model Optimasi Portofolio Saham dengan Aset Bebas Risiko dan Estimasi Risiko dengan Menggunakan Expected Shortfall. Jurnal Sains dan Seni ITS, Vol. 11, No. 2, A70–A76.
[41] Wilcox, R.R., 2021. Introduction to robust estimation and hypothesis testing, Fifth Edition. Elsevier, Inc, Philadelphia.
[42] Xu, R., Wunsch, D.C., 2009. Clustering, Wiley ; IEEE Press, Hoboken, N.J. : Piscataway, NJ.
[43] Yeo, I.-K., 2000. A new family of power transformations to improve normality or symmetry. Biometrika, Vol. 87, No. 4, 954–959.
[44] Zainudin, N.S., Ting, C.-Y., Khor, K.-C., Ng, K.-H., Tong, G.-K., Kalid, S.N., 2024. Clustering Defensive Shariah-compliant Stocks Using Financial Performance as the Indicator. JOIV : International Journal on Informatics Visualization, Vol. 8, No. 1, 115.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Jurnal Matematika, Statistika dan Komputasi

This work is licensed under a Creative Commons Attribution 4.0 International License.

This work is licensed under a Creative Commons Attribution 4.0 International License.
Jurnal Matematika, Statistika dan Komputasi is an Open Access journal, all articles are distributed under the terms of the Creative Commons Attribution License, allowing third parties to copy and redistribute the material in any medium or format, transform, and build upon the material, provided the original work is properly cited and states its license. This license allows authors and readers to use all articles, data sets, graphics and appendices in data mining applications, search engines, web sites, blogs and other platforms by providing appropriate reference.




