Skip to main content
Log in

DeepAR-Attention probabilistic prediction for stock price series

  • Original Article
  • Published:
Neural Computing and Applications Aims and scope Submit manuscript

Abstract

Stock price prediction is a significant research domain, intersecting statistics, finance, and economics. Accurately forecasting stock price trends has always been a focal point for many researchers. However, traditional statistical methods for time series prediction still lack accuracy. The existing deep learning-based methods for stock price prediction have significantly enhanced the accuracy of predicting individual stock prices. However, they are not effective in forecasting the probability range of future stock price trends. In this paper, to address these limitations, we propose a novel DeepAR model based on the attention mechanism (DeepARA) for both single-point and probabilistic predictions of stock prices. This enhances the accuracy and flexibility of stock price forecasting. Although the attention mechanism was initially developed for natural language processing, it has now found applications in time series forecasting, including the dynamics of the stock market. Attention allocates different weights to time points of varying importance, thereby enhancing the model’s ability to capture fundamental market dynamics. We conducted multiple experiments in the Chinese stock market, involving 30 stocks across the top six sectors. Compared with baseline models, the DeepARA model demonstrates superior predictive capabilities.

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
Algorithm 1
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

Data availability

The data that support the findings of this study are available from the corresponding author upon reasonable request.

References

  1. Ou JA, Penman SH (1989) Financial statement analysis and the prediction of stock returns. J Account Econom 11(4):295–329

    Article  Google Scholar 

  2. Wang J-H, Leu J-Y (1996) Stock market trend prediction using arima-based neural networks. In: proceedings of international conference on neural networks (ICNN’96), vol. 4, pp. 2160–2165. IEEE

  3. Cortes C, Vapnik V (1995) Support-vector networks. Mach Learn 20:273–297

    Article  Google Scholar 

  4. Ni L-P, Ni Z-W, Gao Y-Z (2011) Stock trend prediction based on fractal feature selection and support vector machine. Expert Syst Appl 38(5):5569–5576

    Article  Google Scholar 

  5. Thenmozhi M, Sarath Chand G (2016) Forecasting stock returns based on information transmission across global markets using support vector machines. Neural Comput Appl 27:805–824

    Article  Google Scholar 

  6. Dash RK, Nguyen TN, Cengiz K, Sharma A (2023) Fine-tuned support vector regression model for stock predictions. Neural Comput Appl 35(32):23295–23309

    Article  Google Scholar 

  7. Rumelhart DE, Hinton GE, Williams RJ (1986) Learning representations by back-propagating errors. Nature 323(6088):533–536

    Article  Google Scholar 

  8. Wang J-Z, Wang J-J, Zhang Z-G, Guo S-P (2011) Forecasting stock indices with back propagation neural network. Expert Syst Appl 38(11):14346–14355

    Article  Google Scholar 

  9. Singh R, Srivastava S (2017) Stock prediction using deep learning. Multimedia Tools Appl 76(18):18569–18584

    Article  Google Scholar 

  10. Ding X, Zhang Y, Liu T, Duan J (2015) Deep learning for event-driven stock prediction. In: Twenty-fourth international joint conference on artificial intelligence

  11. Yu P, Yan X (2020) Stock price prediction based on deep neural networks. Neural Comput Appl 32:1609–1628

    Article  Google Scholar 

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

    Article  Google Scholar 

  13. Hopfield JJ (1982) Neural networks and physical systems with emergent collective computational abilities. Proc Natl Acad Sci 79(8):2554–2558

    Article  MathSciNet  Google Scholar 

  14. LeCun Y, Bottou L, Bengio Y, Haffner P (1998) Gradient-based learning applied to document recognition. Proc IEEE 86(11):2278–2324

    Article  Google Scholar 

  15. Ma Q, Li S, Zhuang W, Wang J, Zeng D (2020) Self-supervised time series clustering with model-based dynamics. IEEE Trans Neural Netw Learn Syst 32(9):3942–3955

    Article  MathSciNet  Google Scholar 

  16. Selvin S, Vinayakumar R, Gopalakrishnan E, Menon VK, Soman K (2017) Stock price prediction using lstm, rnn and cnn-sliding window model. In: 2017 international conference on advances in computing, communications and informatics (ICACCI), pp. 1643–1647. IEEE

  17. Chen K, Zhou Y, Dai F (2015) A lstm-based method for stock returns prediction: a case study of china stock market. In: 2015 IEEE International Conference on Big Data (big Data), pp. 2823–2824. IEEE

  18. Mukherjee S, Sadhukhan B, Sarkar N, Roy D, De S (2023) Stock market prediction using deep learning algorithms. CAAI Trans Intell Technol 8(1):82–94

    Article  Google Scholar 

  19. Cho K, Van Merriënboer B, Gulcehre C, Bahdanau D, Bougares F, Schwenk H, Bengio Y (2014) Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078

  20. Shen G, Tan Q, Zhang H, Zeng P, Xu J (2018) Deep learning with gated recurrent unit networks for financial sequence predictions. Proced Comput Sci 131:895–903

    Article  Google Scholar 

  21. Jin Z, Yang Y, Liu Y (2020) Stock closing price prediction based on sentiment analysis and lstm. Neural Comput Appl 32(13):9713–9729

    Article  Google Scholar 

  22. Yoo PD, Kim MH, Jan T (2005) Machine learning techniques and use of event information for stock market prediction: A survey and evaluation. In: international conference on computational intelligence for modelling, control and automation and international conference on intelligent agents, web technologies and internet commerce (CIMCA-IAWTIC’06), vol. 2, pp. 835–841. IEEE

  23. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser Ł, Polosukhin I (2017) Attention is all you need. Adv Neural Inform Process Syst 30:17

    Google Scholar 

  24. Salinas D, Flunkert V, Gasthaus J, Januschowski T (2020) Deepar: probabilistic forecasting with autoregressive recurrent networks. Int J Forecast 36(3):1181–1191

    Article  Google Scholar 

  25. Liao Y, Liang C (2021) A temperature time series forecasting model based on deepar. In: 2021 7th international conference on computer and communications (ICCC), pp. 1588–1593. IEEE

  26. Arora P, Jalali SMJ, Ahmadian S, Panigrahi BK, Suganthan P, Khosravi A (2022) Probabilistic wind power forecasting using optimised deep auto-regressive recurrent neural networks. IEEE Trans Ind Inform 19(3):2814–2825

    Article  Google Scholar 

  27. Jiang F, Han X, Zhang W, Chen G (2021) Atmospheric pm2.5 prediction using deepar optimized by sparrow search algorithm with opposition-based and fitness-based learning. Atmosphere 12(7):894

    Article  Google Scholar 

  28. Zhang Q, Qin C, Zhang Y, Bao F, Zhang C, Liu P (2022) Transformer-based attention network for stock movement prediction. Expert Syst Appl 202:117239

    Article  Google Scholar 

  29. Xu H, Chai L, Luo Z, Li S (2022) Stock movement prediction via gated recurrent unit network based on reinforcement learning with incorporated attention mechanisms. Neurocomputing 467:214–228

    Article  Google Scholar 

  30. Chen Y-J, Chen Y-M (2013) A fundamental analysis-based method for stock market forecasting, 354–359

  31. Nti IK, Adekoya AF, Weyori BA (2020) A systematic review of fundamental and technical analysis of stock market predictions. Artif Intell Rev 53(4):3007–3057

    Article  Google Scholar 

  32. Kumbure MM, Lohrmann C, Luukka P, Porras J (2022) Machine learning techniques and data for stock market forecasting: a literature review. Expert Syst Appl 197:116659

    Article  Google Scholar 

  33. Greig AC (1992) Fundamental analysis and subsequent stock returns. J Account Econom 15(2–3):413–442

    Article  Google Scholar 

  34. Mittal A, Goel A (2012) Stock prediction using twitter sentiment analysis. Standford University, CS229 (2011 http://cs229. stanford. edu/proj2011/GoelMittal-StockMarketPredictionUsingTwitterSentimentAnalysis. pdf) 15, 2352

  35. Makrehchi M, Shah S, Liao W (2013) Stock prediction using event-based sentiment analysis. In: 2013 IEEE/WIC/ACM international joint conferences on web intelligence (WI) and intelligent agent technologies (IAT), vol. 1, pp. 337–342. IEEE

  36. Lee H, Surdeanu M, MacCartney B, Jurafsky D (2014) On the importance of text analysis for stock price prediction. LREC 2014:1170–1175

    Google Scholar 

  37. Nguyen TH, Shirai K, Velcin J (2015) Sentiment analysis on social media for stock movement prediction. Expert Syst Appl 42(24):9603–9611

    Article  Google Scholar 

  38. Akita R, Yoshihara A, Matsubara T, Uehara K (2016) Deep learning for stock prediction using numerical and textual information. In: 2016 IEEE/ACIS 15th international conference on computer and information science (ICIS), pp. 1–6

  39. Sohangir S, Wang D, Pomeranets A, Khoshgoftaar TM (2018) Big data: deep learning for financial sentiment analysis. J Big Data 5(1):1–25

    Article  Google Scholar 

  40. Nourbakhsh Z, Habibi N (2022) Combining lstm and cnn methods and fundamental analysis for stock price trend prediction. Multim Tools Appl 1–31

  41. Cavalcante RC, Brasileiro RC, Souza VL, Nobrega JP, Oliveira AL (2016) Computational intelligence and financial markets: a survey and future directions. Expert Syst Appl 55:194–211

    Article  Google Scholar 

  42. Teixeira LA, De Oliveira ALI (2010) A method for automatic stock trading combining technical analysis and nearest neighbor classification. Expert Syst Appl 37(10):6885–6890

    Article  Google Scholar 

  43. Long W, Lu Z, Cui L (2019) Deep learning-based feature engineering for stock price movement prediction. Knowl Based Syst 164:163–173

    Article  Google Scholar 

  44. Jiang W (2021) Applications of deep learning in stock market prediction: recent progress. Expert Syst Appl 184:115537

    Article  Google Scholar 

  45. Ariyo AA, Adewumi AO, Ayo CK (2014) Stock price prediction using the arima model. In: 2014 UKSim-AMSS 16th international conference on computer modelling and simulation, pp. 106–112. IEEE

  46. Adebiyi AA, Adewumi AO, Ayo CK (2014) Comparison of arima and artificial neural networks models for stock price prediction. J Appl Math 2014:4

    Article  MathSciNet  Google Scholar 

  47. Shin D-H, Choi K-H, Kim C-B (2017) Deep learning model for prediction rate improvement of stock price using rnn and lstm. J Korean Inst Inform Technol 15(10):9–16

    Article  Google Scholar 

  48. Chen RT, Rubanova Y, Bettencourt J, Duvenaud DK (2018) Neural ordinary differential equations. Adv Neural Inform Process Syst 31:18

    Google Scholar 

  49. Du S, Luo Y, Chen W, Xu J, Zeng D (2022) To-flow: Efficient continuous normalizing flows with temporal optimization adjoint with moving speed. In: proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12570–12580

  50. Yang F, Chen J, Liu Y (2023) Improved and optimized recurrent neural network based on pso and its application in stock price prediction. Soft Comput 27(6):3461–3476

    Article  Google Scholar 

  51. Chen Y, Wu J, Wu Z (2022) China’s commercial bank stock price prediction using a novel k-means-lstm hybrid approach. Expert Syst Appl 202:117370

    Article  Google Scholar 

  52. Kanwal A, Lau MF, Ng SP, Sim KY, Chandrasekaran S (2022) Bicudnnlstm-1dcnn-a hybrid deep learning-based predictive model for stock price prediction. Expert Syst Appl 202:117123

    Article  Google Scholar 

  53. Li H, Shen Y, Zhu Y (2018) Stock price prediction using attention-based multi-input lstm. In: Asian conference on machine learning, pp. 454–469. PMLR

  54. Cui C, Li X, Zhang C, Guan W, Wang M (2023) Temporal-relational hypergraph tri-attention networks for stock trend prediction. Patt Recogn 143:109759

    Article  Google Scholar 

  55. Lu W, Li J, Wang J, Qin L (2021) A cnn-bilstm-am method for stock price prediction. Neural Comput Appl 33:4741–4753

    Article  Google Scholar 

  56. Wang J, Hu Y, Jiang T-X, Tan J, Li Q (2023) Essential tensor learning for multimodal information-driven stock movement prediction. Knowl Based Syst 262:110262

    Article  Google Scholar 

  57. Pei W, Baltrusaitis T, Tax DM, Morency L-P (2017) Temporal attention-gated model for robust sequence classification. In: proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6730–6739

  58. Rostamian A, O’Hara JG (2022) Event prediction within directional change framework using a cnn-lstm model. Neural Comput Appl 34(20):17193–17205

    Article  Google Scholar 

Download references

Acknowledgments

This work was supported in part by grants from National Science Foundation of China (61571005) and the fundamental research program of Guangdong, China (2020B1515310023, 2023A1515011281).

Author information

Authors and Affiliations

Authors

Contributions

JL contributed to conception and design, data collection, software, analysis and interpretation of results, and writing—original and editing. WC contributed to data visualization, program modification, and writing—reviewing draft. ZZ contributed to writing—reviewing draft and supervision. JY contributed to writing—reviewing draft. DZ contributed to analysis and interpretation of results, writing—review draft, and supervision.

Corresponding author

Correspondence to Delu Zeng.

Ethics declarations

Conflict of interest

The authors declare that there is no conflict of interest regarding the publication of this paper.

Ethical approval

Our study followed ethical guidelines and obtained informed consent from all participants regarding the data used.

Additional information

Publisher's Note

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

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

Li, J., Chen, W., Zhou, Z. et al. DeepAR-Attention probabilistic prediction for stock price series. Neural Comput & Applic (2024). https://doi.org/10.1007/s00521-024-09916-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00521-024-09916-3

Keywords

Navigation