Skip to main content
Log in

Predict Stock Prices Using Supervised Learning Algorithms and Particle Swarm Optimization Algorithm

  • Published:
Computational Economics Aims and scope Submit manuscript

Abstract

Forecasting the stock market has always been one of the challenges for stock market participants to make more profit. Among the problems of stock price forecasting, we can mention its dynamic nature, complexity and its dependence on factors such as the governing system of countries, emotions, economic conditions, inflation, and so on. In recent years, many studies have been conducted to predict the capital stock market using traditional techniques, machine learning algorithms and deep learning. The lower our forecast stock error, the More we can reduce investment risk and increase profitability. In this paper, we present a machine learning (ML) approach called support vector machine (SVM) that can be taught using existing data. SVM extracts knowledge between data and ultimately uses this knowledge to predict new stock data. We have also aimed to select the best SVM method parameters using the particle swarm optimization (PSO) algorithm to prevent over-fitting and improve forecast accuracy. Finally, we compare our proposed method (SVM-PSO) with several other methods, including support vector machine, artificial neural network (ANN) and LSTM. The results show that the proposed algorithm works better than other methods and in all cases, its forecast accuracy is above 90%.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

References

  • Abraham, A., Corchado, E., & Corchado, J. M. (2009). Hybrid learning machines. Neurocomputing: an International Journal, 72, 2729–2730.

    Article  Google Scholar 

  • Adebiyi, A. A., Adewumi, A. O., & Ayo, C. K. (2014). Comparison of ARIMA and artificial neural networks models for stock price prediction. Journal of Applied Mathematics, 2014, 1–7.

    Article  Google Scholar 

  • Alasadi, S. A., & Bhaya, W. S. (2017). Review of data preprocessing techniques in data mining. Journal of Engineering and Applied Sciences, 12(16), 4102–4107.

    Google Scholar 

  • Alvarez Meza, A. M., Daza Santacoloma, G., Acosta Medina, C. D., & Castellanos Dominguez, G. (2012). Parameter selection in least squares-support vector machines regression oriented, using generalized cross-validation. Dyna, 79(171), 23–30.

    Google Scholar 

  • Basak, S., Kar, S., Saha, S., Khaidem, L., & Dey, S. R. (2019). Predicting the direction of stock market prices using tree-based classifiers. The North American Journal of Economic and Finance, 47, 552–567.

    Article  Google Scholar 

  • Cherkassky, V., & Ma, Y. (2004). Practical selection of SVM parameters and noise estimation for SVM regression. Neural Networks, 17(1), 113–126.

    Article  Google Scholar 

  • Cortes, C., & Vapnik, V. (1995). Support-vector networks. Machine Learning, 20(3), 273–297.

    Article  Google Scholar 

  • Dennison, P. E., Halligan, K. Q., & Roberts, D. A. (2004). A comparison of error metrics and constraints for multiple endmember spectral mixture analysis and spectral angle mapper. Remote Sensing of Environment, 93(3), 359–367.

    Article  Google Scholar 

  • Dennison, P. E., & Roberts, D. A. (2003). Endmember selection for multiple endmember spectral mixture analysis using endmember average RMSE. Remote Sensing of Environment, 87(2–3), 123–135.

    Article  Google Scholar 

  • Göçken, M., Özçalıcı, M., Boru, A., & Dosdoğru, A. T. (2016). Integrating metaheuristics and artificial neural networks for improved stock price prediction. Expert Systems with Applications, 44, 320–331.

    Article  Google Scholar 

  • Hafezi, R., Shahrabi, J., & Hadavandi, E. (2015). A bat-neural network multi-agent system (BNNMAS) for stock price prediction: Case study of DAX stock price. Applied Soft Computing, 29, 196–210.

    Article  Google Scholar 

  • Hegazy, O., Soliman, O. S., & Salam, M. A. (2014). A machine learning model for stock mark prediction. arXiv preprint arXiv:1402.7351.

  • Hegazy, O., Soliman, O. S., & Salam, M. A. (2015). Comparative study between FPA, BA, MCS, ABC, and PSO algorithms in training and optimizing of LS-SVM for stock market prediction. International Journal of Advanced Computer Research, 5, 2277–7970.

    Google Scholar 

  • Henrique, B. M., Sobreiro, V. A., & Kimura, H. (2018). Stock price prediction using support vector regression on daily and up to the minute prices. The Journal of Finance and Data Science, 4(3), 183–201.

    Article  Google Scholar 

  • Hernández-Álvarez, M., Hernández, E. A. T., & Yoo, S. G. (2019). Stock market data prediction using machine learning techniques. In: International conference on information technology & systems, 2019. Springer, pp. 539–547.

  • Karazmodeh, M., Nasiri, S., & Hashemi, S. M. (2013). Stock price forecasting using support vector machines and improved particle swarm optimization. Journal of Automation and Control Engineering, 1(2), 173–176.

    Article  Google Scholar 

  • Kennedy, J., & Eberhart, R. (1995). Particle swarm optimization. In: Proceedings of ICNN'95-international conference on neural networks, Vol. 4: IEEE, pp. 1942–1948.

  • Li, X., Xie, H., Chen, L., Wang, J., & Deng, X. (2014). News impact on stock price return via sentiment analysis. Knowledge-Based Systems, 69, 14–23.

    Article  Google Scholar 

  • Mokhtari, S., Yen, K. K., & Liu, J. (2021). Effectiveness of artificial intelligence in stock market prediction based on machine learning. arXiv preprint arXiv:2107.01031.

  • Oh, K. J., & Kim, K.-J. (2002). Analyzing stock market tick data using piecewise nonlinear model. Expert Systems with Applications, 22(3), 249–255.

    Article  Google Scholar 

  • Panigrahi, S., & Behera, H. (2013). Effect of normalization techniques on univariate time series forecasting using evolutionary higher order neural network. International Journal of Engineering and Advanced Technology, 3(2), 280–285.

    Google Scholar 

  • Patel, J., Shah, S., Thakkar, P., & Kotecha, K. (2015). Predicting stock and stock price index movement using trend deterministic data preparation and machine learning techniques. Expert Systems with Applications, 42(1), 259–268.

    Article  Google Scholar 

  • Reddy, V. K. S. (2018). Stock market prediction using machine learning. International Research Journal of Engineering and Technology (IRJET), 5(10), 1033–1035.

    Google Scholar 

  • Sable, R., Goel, S., & Chatterjee, P. (2019). Empirical study on stock market prediction machine learning. In: 2019 International conference on advances in computing, communication and control (ICAC3), 2019: IEEE, pp. 1–5.

  • Tao, X., Renmu, H., Peng, W., & Dongjie, X. (2004). Input dimension reduction for load forecasting based on support vector machines. In: Proceedings of 2004 IEEE international conference on electric utility deregulation, restructuring and power technologies, Vol. 2. IEEE, pp. 510–514.

  • Ullah, A., Imtiaz, F., Ihsan, M. U. M., Alam, M., Rabiul, G., & Majumdar, M. (2021). Combining machine learning classifiers for stock trading with effective feature extraction. arXiv preprint arXiv:2107.13148.

  • Vala, T. M., Rajput, V. N., Geem, Z. W., Pandya, K. S., & Vora, S. C. (2021). Revisiting the performance of evolutionary algorithms. Expert Systems with Applications, 175, 114819.

    Article  Google Scholar 

  • Vijh, M., Chandola, D., Tikkiwal, V. A., & Kumar, A. (2020). Stock closing price prediction using machine learning techniques. Procedia Computer Science, 167, 599–606.

    Article  Google Scholar 

  • Yahoo Finance Website: http://in.finance.yahoo.com

  • Yang, J., Zhao, C., Yu, H., & Chen, H. (2020). Use GBDT to predict the stock market. Procedia Computer Science, 174, 161–171.

    Article  Google Scholar 

  • Yu, L., Pan, Y., & Wu, Y. (2009). Research on data normalization methods in multi-attribute evaluation. In: 2009 International conference on computational intelligence and software engineering, pp. 1–5.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Soodeh Hosseini.

Ethics declarations

Ethical Approval

This article does not contain any studies with human participants or animals performed by any of the authors.

Conflict of interest

The authors declare that they have no conflict of interest.

Informed Consent

The participant has consented to the submission of the case report to the journal.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Bazrkar, M.J., Hosseini, S. Predict Stock Prices Using Supervised Learning Algorithms and Particle Swarm Optimization Algorithm. Comput Econ 62, 165–186 (2023). https://doi.org/10.1007/s10614-022-10273-3

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10614-022-10273-3

Keywords

Navigation