Skip to main content

A Method for Clustering and Predicting Stocks Prices by Using Recurrent Neural Networks

  • Conference paper
  • First Online:
Data and Information in Online Environments (DIONE 2020)

Abstract

Predicting the stock market is a widely studied field, either due to the curiosity in finding an explanation for the behavior of financial assets or for financial purposes. Among these studies the best techniques use neural networks as a prediction tool. More specifically, the best networks for this purpose are called recurrent neural networks (RNN) and provide an extra option when dealing with a sequence of values. However, a great part of the studies is intended to predict the result of few stocks, therefore, this work aims to predict the behavior of a large number of stocks. For this, similar stocks were grouped based on their correlation and later the algorithm K-means was applied so that similar groups were clustered. After this process, the Long Short-Term Memory (LSTM) - a type of RNN - was used in order to predict the price of a certain group of assets. Results showed that clustering stocks did not influence the effectiveness of the network and that investors and portfolio managers can use it to simply their daily tasks.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://www.kaggle.com/borismarjanovic/price-volume-data-for-all-us-stocks-etfs.

References

  1. Affonso, F., de Oliveira, F., Dias, T.M.R.: Uma análise dos fatores que influenciam o movimento acionário das empresas petrolíferas. In: Ibero-Latin American Congress on Computational Methods in Engineering (CILAMCE) (2017)

    Google Scholar 

  2. Bengio, Y., Simard, P., Frasconi, P.: Learning long-term dependencies with gradient descent is difficult. IEEE Trans. Neural Netw. 5(2), 157–166 (1994)

    Article  Google Scholar 

  3. Bini, B.S., Mathew, T.: Clustering and regression techniques for stock prediction. Procedia Technol. 24, 1248–1255 (2016)

    Article  Google Scholar 

  4. Cavalcante, R.C., Brasileiro, R.C., Souza, V.L., Nobrega, J.P., Oliveira, A.L.: Computational intelligence and financial markets: a survey and future directions. Expert Syst. Appl. 55, 194–211 (2016)

    Article  Google Scholar 

  5. Chollet, F.: Keras (2015). https://keras.io

  6. Chong, E., Han, C., Park, F.C.: Deep learning networks for stock market analysis and prediction: methodology, data representations, and case studies. Expert Syst. Appl. 83, 187–205 (2017)

    Article  Google Scholar 

  7. Filho, D.B.F., Júnior, J.A.D.S.: Desvendando os mistérios do coeficiente de correlacão de pearson (r). Universidade Federal de Pernambuco (2009)

    Google Scholar 

  8. Fischer, T., Krauss, C.: Deep learning with long short-term memory networks for financial market predictions. Eur. J. Oper. Res. 270(2), 654–669 (2018)

    Article  MathSciNet  Google Scholar 

  9. Gan, G., Ma, C., Wu, J.: Data Clustering: Theory, Algorithms, and Applications, vol. 20. SIAM (2007)

    Google Scholar 

  10. Gerlein, E.A., McGinnity, M., Belatreche, A., Coleman, S.: Evaluating machine learning classification for financial trading: an empirical approach. Expert Syst. Appl. 54, 193–207 (2016)

    Article  Google Scholar 

  11. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997)

    Article  Google Scholar 

  12. Jung, S.S., Chang, W.: Clustering stocks using partial correlation coefficients. Phys. A: Stat. Mech. Appl. 462, 410–420 (2016)

    Article  Google Scholar 

  13. Ketchen, D.J., Shook, C.L.: The application of cluster analysis in strategic management research: an analysis and critique. Strat. Manag. J. 17(6), 441–458 (1996)

    Article  Google Scholar 

  14. Krauss, C., Do, X.A., Huck, N.: Deep neural networks, gradient-boosted trees, random forests: statistical arbitrage on the S&P 500. Eur. J. Oper. Res. 259(2), 689–702 (2017)

    Article  Google Scholar 

  15. Kumar, B.S., Ravi, V.: A survey of the applications of text mining in financial domain. Knowl.-Based Syst. 114, 128–147 (2016)

    Article  Google Scholar 

  16. Längkvist, M., Karlsson, L., Loutfi, A.: A review of unsupervised feature learning and deep learning for time-series modeling. Pattern Recognit. Lett. 42, 11–24 (2014)

    Article  Google Scholar 

  17. LeCun, Y., Bengio, Y., Hinton, G.: Deep learning. Nature 521(7553), 436 (2015)

    Article  Google Scholar 

  18. Li, Y., Jiang, W., Yang, L., Wu, T.: On neural networks and learning systems for business computing. Neurocomputing 275, 1150–1159 (2018)

    Article  Google Scholar 

  19. Liu, Y., Li, Z., Xiong, H., Gao, X., Wu, J.: Understanding of internal clustering validation measures. In: ICDM, pp. 911–916 (2010)

    Google Scholar 

  20. Mirkin, B.G.: Mathematical Classification and Clustering. Kluwer Academic Publishing, Dordrecht (1996)

    Book  Google Scholar 

  21. Momeni, M., Mohseni, M., Soofi, M.: Clustering stock market companies via k-means algorithm. Kuwait Chap. Arab. J. Bus. Manag. Rev. 4(5), 1 (2015)

    Article  Google Scholar 

  22. Nanda, S.R., Mahanty, B., Tiwari, M.K.: Clustering Indian stock market data for portfolio management. Expert Syst. Appl. 37(12), 8793–8798 (2010)

    Article  Google Scholar 

  23. Nelson, D.M., Pereira, A.C., de Oliveira, R.A.: Stock market’s price movement prediction with LSTM neural networks. In: 2017 International Joint Conference on Neural Networks (IJCNN), pp. 1419–1426. IEEE (2017)

    Google Scholar 

  24. Python Software Foundation: Python 3.5.5 documentation (2018). https://docs.python.org/3.5/

  25. Qiu, M., Song, Y., Akagi, F.: Application of artificial neural network for the prediction of stock market returns: the case of the Japanese stock market. Chaos, Solitons Fractals 85, 1–7 (2016)

    Article  MathSciNet  Google Scholar 

  26. Zhang, J., Cui, S., Xu, Y., Li, Q., Li, T.: A novel data-driven stock price trend prediction system. Expert Syst. Appl. 97, 60–69 (2018)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Felipe Affonso .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 ICST Institute for Computer Sciences, Social Informatics and Telecommunications Engineering

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Affonso, F., Dias, T.M.R., Pinto, A.L. (2020). A Method for Clustering and Predicting Stocks Prices by Using Recurrent Neural Networks. In: Mugnaini, R. (eds) Data and Information in Online Environments. DIONE 2020. Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering, vol 319. Springer, Cham. https://doi.org/10.1007/978-3-030-50072-6_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-50072-6_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-50071-9

  • Online ISBN: 978-3-030-50072-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics