Skip to main content
Log in

Modification of hybrid RNN-HMM model in asset pricing: univariate and multivariate cases

  • Published:
Applied Intelligence Aims and scope Submit manuscript

Abstract

Hidden Markov Model (HMM) which is frequently used in time series modeling with satisfactory results is commonly used for predicting stock prices in many studies. Due to its more transparent structure than most of the current Neural Network (NN) models and its sensitivity to the initial parameter settings, we propose a hybrid model that combines Recurrent NN (RNN) and HMM in modeling stock prices to eliminate initial parameter influence. Despite its common application to speech recognition data with categorical variables, we reconstruct RNN and HMM for financial data. RNN is used as a solution to the probability of not reaching the global maximum based on the HMM’s initial parameters selection. To do so, we improve the classification power of HMM to achieve the hidden states that do not get stuck at a local maximum but provide the global maximum. In addition, unlike the literature, the loss function is not chosen as the maximum likelihood but is defined directly over the prices. Thus, the model does not only detect the states appropriately, yet the predictions can get closer to the actual prices. Besides, a multivariate comparison is performed to determine the effect of different numbers and types of variables through bivariate and trivariate models. The application is made on S &P 500, Nasdaq daily closing prices and daily EUR/USD exchange rates data from 2000 to 2021. It is shown that the accuracy is increased significantly compared to the implementations of HMM and RNN methods separately.

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
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14

Similar content being viewed by others

Availability of data and materials

The datasets analysed during the current study are openly available in the public domain resource [Yahoo Finance] at https://finance.yahoo.com.

References

  1. Bishop CM, Nasrabadi NM (2006) Pattern Recognition and Machine Learning. Springer, New York

    Google Scholar 

  2. Collobert, R., Weston, J.: A unified architecture for natural language processing: Deep neural networks with multitask learning. In: Proceedings of the 25th International Conference on Machine Learning, pp. 160–167 (2008)

  3. Khan AI, Al-Habsi S (2020) Machine learning in computer vision. Procedia Computer Science 167:1444–1451

    Article  Google Scholar 

  4. Boukerche A, Wang J (2020) Machine learning-based traffic prediction models for intelligent transportation systems. Computer Networks 181:107530

    Article  Google Scholar 

  5. Fujiyoshi H, Hirakawa T, Yamashita T (2019) Deep learning-based image recognition for autonomous driving. IATSS research 43(4):244–252

    Article  Google Scholar 

  6. Kononenko I (2001) Machine learning for medical diagnosis: history, state of the art and perspective. Artificial Intelligence in medicine 23(1):89–109

    Article  Google Scholar 

  7. Gogas P, Papadimitriou T (2021) Machine learning in economics and finance. Computational Economics 57(1):1–4

    Article  Google Scholar 

  8. Wang, H., Li, C., Gu, B., Min, W.: Does ai-based credit scoring improve financial inclusion? evidence from online payday lending. In: 40th International Conference on Information Systems, ICIS 2019 (1984). Association for Information Systems

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

    Article  Google Scholar 

  10. Chung, J., Gulcehre, C., Cho, K., Bengio, Y.: Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555 (2014)

  11. Hsieh T-J, Hsiao H-F, Yeh W-C (2011) Forecasting stock markets using wavelet transforms and recurrent neural networks: An integrated system based on artificial bee colony algorithm. Applied soft computing 11(2):2510–2525

    Article  Google Scholar 

  12. 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 (2017). IEEE

  13. Shao, X., Ma, D., Liu, Y., Yin, Q.: Short-term forecast of stock price of multi-branch lstm based on k-means. In: 2017 4th International Conference on Systems and Informatics (ICSAI), pp. 1546–1551 (2017). IEEE

  14. Sethia, A., Raut, P.: Application of lstm, gru and ica for stock price prediction. In: Information and Communication Technology for Intelligent Systems: Proceedings of ICTIS 2018, Volume 2, pp. 479–487 (2019). Springer

  15. Minh DL, Sadeghi-Niaraki A, Huy HD, Min K, Moon H (2018) Deep learning approach for short-term stock trends prediction based on two-stream gated recurrent unit network. Ieee Access 6:55392–55404

    Article  Google Scholar 

  16. Polamuri SR, Srinivas K, Mohan AK (2020) Multi model-based hybrid prediction algorithm (mm-hpa) for stock market prices prediction framework (smppf). Arabian Journal for Science and Engineering 45:10493–10509

    Article  Google Scholar 

  17. Jain, S., Gupta, R., Moghe, A.A.: Stock price prediction on daily stock data using deep neural networks. In: 2018 International Conference on Advanced Computation and Telecommunication (ICACAT), pp. 1–13 (2018). IEEE

  18. Patel J, Shah S, Thakkar P, Kotecha K (2015) Predicting stock market index using fusion of machine learning techniques. Expert Systems with Applications 42(4):2162–2172

    Article  Google Scholar 

  19. Zhang Y, Tiňo P, Leonardis A, Tang K (2021) A survey on neural network interpretability. IEEE Transactions on Emerging Topics in Computational Intelligence 5(5):726–742

    Article  Google Scholar 

  20. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł., Polosukhin, I.: Attention is all you need. Advances in neural information processing systems 30 (2017)

  21. Corbetta M, Shulman GL (2002) Control of goal-directed and stimulus-driven attention in the brain. Nature reviews neuroscience 3(3):201–215

    Article  Google Scholar 

  22. Niu Z, Zhong G, Yu H (2021) A review on the attention mechanism of deep learning. Neurocomputing 452:48–62

    Article  Google Scholar 

  23. Hu, Z., Liu, W., Bian, J., Liu, X., Liu, T.-Y.: Listening to chaotic whispers: A deep learning framework for news-oriented stock trend prediction. In: Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pp. 261–269 (2018)

  24. Liu, J., Lin, H., Liu, X., Xu, B., Ren, Y., Diao, Y., Yang, L.: Transformer-based capsule network for stock movement prediction. In: Proceedings of the First Workshop on Financial Technology and Natural Language Processing, pp. 66–73 (2019)

  25. Wang, H., Wang, T., Li, Y.: Incorporating expert-based investment opinion signals in stock prediction: A deep learning framework. In: Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, pp. 971–978 (2020)

  26. Xu H, Chai L, Luo Z, Li S (2020) Stock movement predictive network via incorporative attention mechanisms based on tweet and historical prices. Neurocomputing 418:326–339

    Article  Google Scholar 

  27. Zhang Q, Qin C, Zhang Y, Bao F, Zhang C, Liu P (2022) Transformer-based attention network for stock movement prediction. Expert Systems with Applications 202:117239

    Article  Google Scholar 

  28. Alotaibi SS (2021) Ensemble technique with optimal feature selection for saudi stock market prediction: a novel hybrid red deer-grey algorithm. IEEE Access 9:64929–64944

    Article  Google Scholar 

  29. Visser, I., Speekenbrink, M.: Introduction and Preliminaries, pp. 1–43. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-01440-6_1

  30. Bengio, Y., Cardin, R., De Mori, R., Normandin, Y.: A hybrid coder for hidden markov models using a recurrent neural networks. In: International Conference on Acoustics, Speech, and Signal Processing, pp. 537–540 (1990). IEEE

  31. Hassan MR, Nath B, Kirley M (2007) A fusion model of hmm, ann and ga for stock market forecasting. Expert Systems with Applications 33(1):171–180

    Article  Google Scholar 

  32. Bengio Y, De Mori R, Flammia G, Kompe R (1992) Global optimization of a neural network-hidden markov model hybrid. IEEE Transactions on Neural Networks 3(2):252–259

    Article  Google Scholar 

  33. Tang, X.: Hybrid hidden markov model and artificial neural network for automatic speech recognition. In: 2009 Pacific-Asia Conference on Circuits, Communications and Systems, pp. 682–685 (2009). IEEE

  34. Rabiner LR (1989) A tutorial on hidden markov models and selected applications in speech recognition. Proceedings of the IEEE 77(2):257–286

    Article  Google Scholar 

  35. Ghahramani Z (2001) An introduction to hidden markov models and bayesian networks. International journal of pattern recognition and artificial intelligence 15(01):9–42

    Article  Google Scholar 

  36. Bhar R, Hamori S (2004) Hidden Markov Models: Applications to Financial Economics, vol 40. Springer, New York

    MATH  Google Scholar 

  37. Dempster, A.P., Laird, N.M., Rubin, D.B.: Maximum likelihood from incomplete data via the em algorithm. Journal of the royal statistical society. Series B (methodological), 1–38 (1977)

  38. Visser, I., Speekenbrink, M.: Multivariate Hidden Markov Models, pp. 201–230. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-01440-6_6

  39. Oflaz ZN, Yozgatligil C, Selcuk-Kestel AS (2019) Aggregate claim estimation using bivariate hidden markov model. ASTIN Bulletin: The Journal of the IAA 49(1):189–215

    Article  MathSciNet  MATH  Google Scholar 

  40. Abraham, A.: Artificial neural networks. handbook of measuring system design (2005)

  41. He X, Xu S (2010) Process Neural Networks: Theory and Applications. Springer, New York

    Book  Google Scholar 

  42. Rojas R (2013) Neural Networks: a Systematic Introduction. Springer, New York

    MATH  Google Scholar 

Download references

Funding

The authors did not receive support from any organization for the submitted work.

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Dilek Aydogan-Kilic or A. Sevtap Selcuk-Kestel.

Ethics declarations

Conflict of interest

The authors have no relevant financial or non-financial interests to disclose.

Additional information

Publisher's Note

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

Appendix: Parameters of the RNN, RNN-HMM, LSTM and GRU experiments

Appendix: Parameters of the RNN, RNN-HMM, LSTM and GRU experiments

The common parameters of each RNN, RNN-HMM, LSTM and GRU experiment are mentioned in Section 3.2. Moreover, the remaining parameters of learning rate and epoch numbers of RNN and RNN-HMM are presented in Table 15, and the unmentioned parameters of LSTM and GRU are shown in Table 16 and 17, respectively.

Table 15 Learning Rates and Epoch Numbers of the RNN and RNN-HMM Experiments
Table 16 Parameters of the LSTM Experiments
Table 17 Parameters of the GRU Experiments

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Aydogan-Kilic, D., Selcuk-Kestel, A.S. Modification of hybrid RNN-HMM model in asset pricing: univariate and multivariate cases. Appl Intell 53, 23812–23833 (2023). https://doi.org/10.1007/s10489-023-04762-7

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10489-023-04762-7

Keywords

Navigation