Stock Trend Prediction with Machine Learning: Incorporating Inter-Stock Correlation Information through Laplacian Matrix
Abstract
:1. Introduction
2. Related Work
2.1. Statistical Methods
2.2. Artificial Intelligence Models
2.2.1. Machine Learning Methods
2.2.2. Deep Learning Methods
3. Problem Formulation
4. Our Framework
4.1. Correlation Matrix
4.2. Laplacian Matrices of Graphs
4.3. Laplacian Correlation Graph
4.4. Training Loss Design
Algorithm 1 LOG framework. |
Input: Stock pool , Features F, base model , ; Output: ; Calculate for all do ; MSE; Mean; ; Optimizing algorithms to update by minimizing ; end for return . |
5. Experiments
5.1. Datasets
5.2. Data Processing
5.3. Experiment Settings
- MLP: a multi-layer perceptron (MLP) with two layers. The number of units on each layer is 64. The dropout probability of each layer is 0.5.
- GRU [39]: a two-layer gated recurrent unit (GRU) network. The number of units on each layer is 64.
- LSTM [40]: a two-layer long short-term memory (LSTM) network. The number of units on each layer is 64.
- GAT [41]: a two-layer graph attention network (GAT). We use a GRU network as the embedding module. Each stock is a node and the attention coefficient between stock i and stock j is a linear transformation of their hidden representations obtained by the embedding GRU. The coefficients are then normalized using the softmax function.
5.4. Predictive Ability of Our Model
5.5. Backtesting Results
5.6. Statistical Tests on Profitability Improvements
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Markowitz, H. Portfolio Selection. J. Financ. 1952, 7, 77–91. [Google Scholar]
- Sukcharoen, K.; Leatham, D.J. Dependence and extreme correlation among US industry sectors. Stud. Econ. Financ. 2016, 33, 26–49. [Google Scholar] [CrossRef]
- Cao, D.; Long, W.; Yang, W. Sector indices correlation analysis in China’s stock market. Proc. Comput. Sci. 2013, 17, 1241–1249. [Google Scholar] [CrossRef]
- Wang, J.J.; Wang, J.Z.; Zhang, Z.G.; Guo, S.P. Stock index forecasting based on a hybrid model. Omega 2012, 40, 758–766. [Google Scholar] [CrossRef]
- Kim, R.; So, C.H.; Jeong, M.; Lee, S.; Kim, J.; Kang, J. Hats: A hierarchical graph attention network for stock movement prediction. arXiv 2019, arXiv:1908.07999. [Google Scholar]
- Dai, Z.; Zhu, H.; Kang, J. New technical indicators and stock returns predictability. Int. Rev. Econ. Financ. 2021, 71, 127–142. [Google Scholar] [CrossRef]
- Liu, M.; Xiao, L.; Jiang, H.; He, Q. CCAT-NET: A Novel Transformer Based Semi-Supervised Framework for COVID-19 Lung Lesion Segmentation. In Proceedings of the 2022 IEEE 19th International Symposium on Biomedical Imaging (ISBI), Kolkata, India, 28–31 March 2022; pp. 1–5. [Google Scholar]
- Bhattacharjee, I.; Bhattacharja, P. Stock price prediction: A comparative study between traditional statistical approach and machine learning approach. In Proceedings of the 2019 4th International Conference on Electrical Information and Communication Technology, Khulna, Bangladesh, 20–22 December 2019; pp. 1–6. [Google Scholar]
- Ariyo, A.A.; Adewumi, A.O.; Ayo, C.K. Stock price prediction using the ARIMA model. In Proceedings of the 2014 UKSim—AMSS 16th International Conference on Computer Modelling and Simulation, Cambridge, UK, 26–28 March 2014; pp. 106–112. [Google Scholar]
- Franses, P.H.; Ghijsels, H. Additive outliers, GARCH and forecasting volatility. Int. J. Forecast. 1999, 15, 1–9. [Google Scholar] [CrossRef]
- Nair, B.B.; Mohandas, V.; Sakthivel, N. A decision tree-rough set hybrid system for stock market trend prediction. Int. J. Comput. Appl. 2010, 6, 1–6. [Google Scholar] [CrossRef]
- Wang, J.L.; Chan, S.H. Stock market trading rule discovery using two-layer bias decision tree. Expert Syst. Appl. 2006, 30, 605–611. [Google Scholar] [CrossRef]
- Grigoryan, H. A Stock Market Prediction Method Based on Support Vector Machines (SVM) and Independent Component Analysis (ICA). Database Syst. J. 2016, 7, 12–21. [Google Scholar]
- Tay, F.E.; Cao, L. Application of support vector machines in financial time series forecasting. Omega 2001, 29, 309–317. [Google Scholar] [CrossRef]
- Ho, T.K.; Hull, J.J.; Srihari, S.N. Decision combination in multiple classifier systems. IEEE Trans. Pattern Anal. Mach. Intell. 1994, 16, 66–75. [Google Scholar]
- Khaidem, L.; Saha, S.; Dey, S.R. Predicting the direction of stock market prices using random forest. arXiv 2016, arXiv:1605.00003. [Google Scholar]
- Tsai, C.F.; Lin, Y.C.; Yen, D.C.; Chen, Y.M. Predicting stock returns by classifier ensembles. Appl. Soft Comput. 2011, 11, 2452–2459. [Google Scholar] [CrossRef]
- Pan, H.; Tilakaratne, C.; Yearwood, J. Predicting the Australian stock market index using neural networks exploiting dynamical swings and intermarket influences. In Proceedings of the AI 2003: Advances in Artificial Intelligence, Perth, Australia, 3–5 December 2003; pp. 327–338. [Google Scholar]
- Situngkir, H.; Surya, Y. Neural network revisited: Perception on modified Poincare map of financial time-series data. Phys. A Stat. Mech. Its Appl. 2004, 344, 100–103. [Google Scholar] [CrossRef]
- Turchenko, V.; Beraldi, P.; De Simone, F.; Grandinetti, L. Short-term stock price prediction using MLP in moving simulation mode. In Proceedings of the 6th IEEE International Conference on Intelligent Data Acquisition and Advanced Computing Systems, Prague, Czech Republic, 15–17 September 2011; Volume 2, pp. 666–671. [Google Scholar]
- Chen, K.; Zhou, Y.; Dai, F. A LSTM-based method for stock returns prediction: A case study of China stock market. In Proceedings of the 2015 IEEE International Conference on Big Data, Santa Clara, CA, USA, 29 October–1 November 2015; pp. 2823–2824. [Google Scholar]
- Nelson, D.M.; Pereira, A.C.; De Oliveira, R.A. Stock market’s price movement prediction with LSTM neural networks. In Proceedings of the 2017 International Joint Conference on Neural Networks, Anchorage, AL, USA, 14–19 May 2017; pp. 1419–1426. [Google Scholar]
- Roondiwala, M.; Patel, H.; Varma, S. Predicting stock prices using LSTM. Int. J. Sci. Res. 2017, 6, 1754–1756. [Google Scholar]
- Qu, G.; Hu, W.; Xiao, L.; Wang, J.; Bai, Y.; Patel, B.; Zhang, K.; Wang, Y.P. Brain Functional Connectivity Analysis via Graphical Deep Learning. IEEE Trans. Biomed. Eng. 2022, 69, 1696–1706. [Google Scholar] [CrossRef] [PubMed]
- Xu, W.; Liu, W.; Wang, L.; Xia, Y.; Bian, J.; Yin, J.; Liu, T.Y. Hist: A graph-based framework for stock trend forecasting via mining concept-oriented shared information. arXiv 2021, arXiv:2110.13716. [Google Scholar]
- Li, W.; Bao, R.; Harimoto, K.; Chen, D.; Xu, J.; Su, Q. Modeling the stock relation with graph network for overnight stock movement prediction. In Proceedings of the 29th International Joint Conference on Artificial Intelligence, Yokohama, Japan, 11–17 July 2020; pp. 4541–4547. [Google Scholar]
- Long, J.; Chen, Z.; He, W.; Wu, T.; Ren, J. An integrated framework of deep learning and knowledge graph for prediction of stock price trend: An application in Chinese stock exchange market. Appl. Soft Comput. 2020, 91, 106205. [Google Scholar] [CrossRef]
- Wu, J.; Xu, K.; Chen, X.; Li, S.; Zhao, J. Price graphs: Utilizing the structural information of financial time series for stock prediction. Inf. Sci. 2022, 588, 405–424. [Google Scholar] [CrossRef]
- Ding, Q.; Wu, S.; Sun, H.; Guo, J.; Guo, J. Hierarchical Multi-Scale Gaussian Transformer for Stock Movement Prediction. In Proceedings of the 29th International Joint Conference on Artificial Intelligence, Yokohama, Japan, 11–17 July 2020; pp. 4640–4646. [Google Scholar]
- Zhong, X.; Enke, D. Forecasting daily stock market return using dimensionality reduction. Expert Syst. Appl. 2017, 67, 126–139. [Google Scholar] [CrossRef]
- Zhong, X.; Enke, D. Predicting the daily return direction of the stock market using hybrid machine learning algorithms. Financ. Innov. 2019, 5, 24. [Google Scholar] [CrossRef]
- Singh, H.; Sharma, R. Role of adjacency matrix & adjacency list in graph theory. Int. J. Comput. Technol. 2012, 3, 179–183. [Google Scholar]
- Tumminello, M.; Aste, T.; Di Matteo, T.; Mantegna, R.N. A tool for filtering information in complex systems. Proc. Natl. Acad. Sci. USA 2005, 102, 10421–10426. [Google Scholar] [CrossRef] [PubMed]
- Dees, B.S.; Stanković, L.; Constantinides, A.G.; Mandic, D.P. Portfolio cuts: A graph-theoretic framework to diversification. In Proceedings of the ICASSP 2020—2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Virtual, 4–9 May 2020; pp. 8454–8458. [Google Scholar]
- Mantegna, R.N. Hierarchical structure in financial markets. Eur. Phys. J. Condens. Matter Complex Syst. 1999, 11, 193–197. [Google Scholar] [CrossRef]
- Engle, R. Dynamic Conditional Correlation. J. Bus. Econ. Stat. 2002, 20, 339–350. [Google Scholar] [CrossRef]
- Karanasos, M.; Paraskevopoulos, A.G.; Menla Ali, F.; Karoglou, M.; Yfanti, S. Modelling stock volatilities during financial crises: A time varying coefficient approach. J. Empir. Financ. 2014, 29, 113–128. [Google Scholar] [CrossRef]
- Yang, X.; Liu, W.; Zhou, D.; Bian, J.; Liu, T.Y. Qlib: An ai-oriented quantitative investment platform. arXiv 2020, arXiv:2009.11189. [Google Scholar]
- Chung, J.; Gulcehre, C.; Cho, K.; Bengio, Y. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv 2014, arXiv:1412.3555. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Veličković, P.; Cucurull, G.; Casanova, A.; Romero, A.; Lio, P.; Bengio, Y. Graph attention networks. arXiv 2017, arXiv:1710.10903. [Google Scholar]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems; Neural Information Processing Systems Foundation, Inc. (NeurIPS): La Jolla, CA, USA, 2017; Volume 30. [Google Scholar]
- Wang, C.; Chen, Y.; Zhang, S.; Zhang, Q. Stock market index prediction using deep Transformer model. Expert Syst. Appl. 2022, 208, 118128. [Google Scholar] [CrossRef]
- Goodwin, T.H. The Information Ratio. Financ. Anal. J. 1998, 54, 34–43. [Google Scholar] [CrossRef]
- Zhang, F.; Guo, R.; Cao, H. Information Coefficient as a Performance Measure of Stock Selection Models. arXiv 2020, arXiv:2010.08601. [Google Scholar]
- Magdon-Ismail, M.; Atiya, A.F. Maximum drawdown. Risk Mag. 2004, 17, 99–102. [Google Scholar]
- Lu, Z.; Yuan, K.H. Welch’s t Test; Sage: Thousand Oaks, CA, USA, 2010; pp. 1620–1623. [Google Scholar]
Methods | CSI100 | CSI300 | ||||
---|---|---|---|---|---|---|
IC | Rank IC | CR | IC | Rank IC | CR | |
MLP | 0.0649 (1.60 × ) | 0.0628 (1.69 × ) | 0.9836 (1.05 × ) | 0.0747 (1.22 × ) | 0.0717 (1.23 × ) | 3.6233 (2.75 × ) |
MLP + LOG | 0.0666 (8.96 × ) | 0.0645 (1.26 × ) | 1.1015 (9.14 × ) | 0.0752 (8.70 × ) | 0.0727 (8.82 × ) | 3.9937 (2.94 × ) |
GRU | 0.0653 (8.31 × ) | 0.0625 (8.74 × ) | 1.0086 (6.80 × ) | 0.0761 (8.58 × ) | 0.0733 (9.16 × ) | 3.4192 (2.98 × ) |
GRU + LOG | 0.0680 (1.23 × ) | 0.0655 (1.47 × ) | 1.1753 (5.92 × ) | 0.0770 (1.27 × ) | 0.0740 (1.15 × ) | 3.7135 (3.80 × ) |
LSTM | 0.0654 (1.75 × ) | 0.0632 (1.69 × ) | 1.0387 (9.44 × ) | 0.0735 (1.16 × ) | 0.0706 (1.14 × ) | 3.6282 (2.40 × ) |
LSTM + LOG | 0.0666 (1.58 × ) | 0.0641 (1.65 × ) | 1.1634 (8.00 × ) | 0.0737 (1.06 × ) | 0.0710 (9.41 × ) | 3.8031 (4.08 × ) |
GAT | 0.0594 (2.64 × ) | 0.0573 (2.22 × ) | 0.8648 (6.03 × ) | 0.0713 (1.36 × ) | 0.0690 (1.16 × ) | 3.1322 (1.97 × ) |
GAT + LOG | 0.0615 (2.20 × ) | 0.0592 (2.33 × ) | 0.9552 (8.58 × ) | 0.0716 (1.74 × ) | 0.0693 (1.82 × ) | 3.2590 (2.60 × ) |
Transformer | 0.0561 (1.76 × ) | 0.0555 (1.90 × ) | 0.7026 (7.95 × ) | 0.0665 (1.74 × ) | 0.0653 (1.67 × ) | 2.9362 (2.59 × ) |
Transformer + LOG | 0.0573 (2.22 × ) | 0.0574 (1.69 × ) | 0.8176 (7.75 × ) | 0.0700 (1.56 × ) | 0.0683 (1.45 × ) | 3.1703 (3.14 × ) |
Methods | CSI100 | CSI300 | ||||
---|---|---|---|---|---|---|
AER | MDD | IR | AER | MDD | IR | |
MLP | 0.0412 (7.24 × ) | −0.1371 (1.22 × ) | 0.6013 (1.05 × ) | 0.1624 (9.34 × ) | −0.1800 (1.86 × ) | 1.6493 (7.92 × ) |
MLP + LOG | 0.0491 (5.88 × ) | −0.1299 (1.03 × ) | 0.7217 (8.71 × ) | 0.1741 (9.10 × ) | −0.1719 (7.16 × ) | 1.8003 (1.04 × ) |
GRU | 0.0432 (4.62 × ) | −0.1284 (1.33 × ) | 0.6299 (6.60 × ) | 0.1556 (1.01 × ) | −0.1956 (1.82 × ) | 1.6079 (1.16 × ) |
GRU + LOG | 0.0542 (3.67 × ) | −0.1212 (8.43 × ) | 0.7985 (5.15 × ) | 0.1652 (1.21 × ) | −0.1771 (1.30 × ) | 1.7529 (1.39 × ) |
LSTM | 0.0455 (6.20 × ) | −0.1246 (7.48 × ) | 0.6606 (9.62 × ) | 0.1628 (7.89 × ) | −0.1776 (1.44 × ) | 1.6899 (8.95 × ) |
LSTM + LOG | 0.0540 (4.98 × ) | −0.1257 (6.62 × ) | 0.7923 (7.70 × ) | 0.1681 (1.27 × ) | −0.1750 (2.40 × ) | 1.8163 (1.43 × ) |
GAT | 0.0334 (4.28 × ) | −0.1344 (1.68 × ) | 0.4820 (6.55 × ) | 0.1457 (7.06 × ) | −0.1815 (1.08 × ) | 1.5031 (7.30 × ) |
GAT + LOG | 0.0398 (5.95 × ) | −0.1308 (1.31 × ) | 0.5763 (8.76 × ) | 0.1501 (9.02 × ) | −0.1794 (1.75 × ) | 1.5731 (1.03 × ) |
Transformer | 0.0203 (6.39 × ) | −0.1469 (2.47 × ) | 0.2910 (9.25 × ) | 0.1380 (9.51 × ) | −0.1870 (1.28 × ) | 1.3612 (8.10 × ) |
Transformer + LOG | 0.0292 (5.64 × ) | −0.1342 (1.22 × ) | 0.4251 (8.35 × ) | 0.1466 (1.12 × ) | −0.1741 (2.42 × ) | 1.5373 (1.29 × ) |
Methods | CSI100 | CSI300 | ||||
---|---|---|---|---|---|---|
tw | df | tdf,α | tw | df | tdf,α | |
MLP | −2.54 | 18 | −1.330 | −2.76 | 18 | −1.330 |
GRU | −5.55 | 18 | −1.330 | −1.82 | 17 | −1.333 |
LSTM | −3.03 | 18 | −1.330 | −1.13 | 18 | −1.330 |
GAT | −2.59 | 16 | −1.337 | −1.18 | 18 | −1.330 |
Transformer | −3.11 | 18 | −1.330 | −1.72 | 17 | −1.333 |
Methods | CSI100 | CSI300 | ||||
---|---|---|---|---|---|---|
tw | df | tdf,α | tw | df | tdf,α | |
MLP | −2.55 | 17 | −1.333 | −2.68 | 18 | −1.330 |
GRU | −5.59 | 17 | −1.333 | −1.83 | 17 | −1.333 |
LSTM | −3.21 | 17 | −1.333 | −1.16 | 18 | −1.330 |
GAT | −2.63 | 16 | −1.337 | −1.22 | 17 | −1.333 |
Transformer | −3.11 | 18 | −1.330 | −1.74 | 18 | −1.330 |
Methods | CSI100 | CSI300 | ||||
---|---|---|---|---|---|---|
tw | df | tdf,α | tw | df | tdf,α | |
MLP | −2.64 | 17 | −1.333 | −3.47 | 17 | −1.333 |
GRU | −6.04 | 17 | −1.333 | −2.39 | 17 | −1.333 |
LSTM | −3.21 | 17 | −1.333 | −2.25 | 15 | −1.341 |
GAT | −2.59 | 17 | −1.333 | −1.66 | 16 | −1.337 |
Transformer | −3.23 | 18 | −1.330 | −3.47 | 15 | −1.341 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhang, W.; Lu, B. Stock Trend Prediction with Machine Learning: Incorporating Inter-Stock Correlation Information through Laplacian Matrix. Big Data Cogn. Comput. 2024, 8, 56. https://doi.org/10.3390/bdcc8060056
Zhang W, Lu B. Stock Trend Prediction with Machine Learning: Incorporating Inter-Stock Correlation Information through Laplacian Matrix. Big Data and Cognitive Computing. 2024; 8(6):56. https://doi.org/10.3390/bdcc8060056
Chicago/Turabian StyleZhang, Wenxuan, and Benzhuo Lu. 2024. "Stock Trend Prediction with Machine Learning: Incorporating Inter-Stock Correlation Information through Laplacian Matrix" Big Data and Cognitive Computing 8, no. 6: 56. https://doi.org/10.3390/bdcc8060056
APA StyleZhang, W., & Lu, B. (2024). Stock Trend Prediction with Machine Learning: Incorporating Inter-Stock Correlation Information through Laplacian Matrix. Big Data and Cognitive Computing, 8(6), 56. https://doi.org/10.3390/bdcc8060056