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.
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
Ou JA, Penman SH (1989) Financial statement analysis and the prediction of stock returns. J Account Econom 11(4):295–329
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
Cortes C, Vapnik V (1995) Support-vector networks. Mach Learn 20:273–297
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
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
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
Rumelhart DE, Hinton GE, Williams RJ (1986) Learning representations by back-propagating errors. Nature 323(6088):533–536
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
Singh R, Srivastava S (2017) Stock prediction using deep learning. Multimedia Tools Appl 76(18):18569–18584
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
Yu P, Yan X (2020) Stock price prediction based on deep neural networks. Neural Comput Appl 32:1609–1628
Hochreiter S, Schmidhuber J (1997) Long short-term memory. Neural Comput 9(8):1735–1780
Hopfield JJ (1982) Neural networks and physical systems with emergent collective computational abilities. Proc Natl Acad Sci 79(8):2554–2558
LeCun Y, Bottou L, Bengio Y, Haffner P (1998) Gradient-based learning applied to document recognition. Proc IEEE 86(11):2278–2324
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
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
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
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
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
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
Jin Z, Yang Y, Liu Y (2020) Stock closing price prediction based on sentiment analysis and lstm. Neural Comput Appl 32(13):9713–9729
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
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
Salinas D, Flunkert V, Gasthaus J, Januschowski T (2020) Deepar: probabilistic forecasting with autoregressive recurrent networks. Int J Forecast 36(3):1181–1191
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
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
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
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
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
Chen Y-J, Chen Y-M (2013) A fundamental analysis-based method for stock market forecasting, 354–359
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
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
Greig AC (1992) Fundamental analysis and subsequent stock returns. J Account Econom 15(2–3):413–442
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
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
Lee H, Surdeanu M, MacCartney B, Jurafsky D (2014) On the importance of text analysis for stock price prediction. LREC 2014:1170–1175
Nguyen TH, Shirai K, Velcin J (2015) Sentiment analysis on social media for stock movement prediction. Expert Syst Appl 42(24):9603–9611
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
Sohangir S, Wang D, Pomeranets A, Khoshgoftaar TM (2018) Big data: deep learning for financial sentiment analysis. J Big Data 5(1):1–25
Nourbakhsh Z, Habibi N (2022) Combining lstm and cnn methods and fundamental analysis for stock price trend prediction. Multim Tools Appl 1–31
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
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
Long W, Lu Z, Cui L (2019) Deep learning-based feature engineering for stock price movement prediction. Knowl Based Syst 164:163–173
Jiang W (2021) Applications of deep learning in stock market prediction: recent progress. Expert Syst Appl 184:115537
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
Adebiyi AA, Adewumi AO, Ayo CK (2014) Comparison of arima and artificial neural networks models for stock price prediction. J Appl Math 2014:4
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
Chen RT, Rubanova Y, Bettencourt J, Duvenaud DK (2018) Neural ordinary differential equations. Adv Neural Inform Process Syst 31:18
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
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
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
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
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
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
Lu W, Li J, Wang J, Qin L (2021) A cnn-bilstm-am method for stock price prediction. Neural Comput Appl 33:4741–4753
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
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
Rostamian A, O’Hara JG (2022) Event prediction within directional change framework using a cnn-lstm model. Neural Comput Appl 34(20):17193–17205
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
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
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.
About this article
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
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s00521-024-09916-3