STGAT: Spatial–Temporal Graph Attention Neural Network for Stock Prediction
Abstract
:1. Introduction
- 1.
- By employing the Pearson correlation coefficient as a metric for stock correlation, the flattened stock market data are converted into graph data that encapsulate rich structural information. The graph attention module introduced in this work is used to capture spatial features and identify correlation patterns within the stock market.
- 2.
- By applying time series decomposition, the stock price data aRE separated into trend, seasonal, and residual components. Different parts of the stock information are then used as inputs to distinct modules, leading to improved performance and accuracy in this work.
- 3.
- A pioneering graph attention network and temporal convolutional network with a residual attention mechanism are proposed to effectively capture the dynamic spatial features of the stock market. These networks uncover deeper patterns both within and among stocks, providing critical features for stock price prediction.
- 4.
- The integration of graph attention network and temporal convolutional network effectively combines spatial and temporal features, resulting in improved performance in stock price prediction and portfolio optimization. This approach offers a new intelligent model for financial portfolio management by striking a reasonable balance between risk and return.
2. Related Works
2.1. Time Series Analysis Research on Stock Price Prediction
- Statistics-based forecasting models.The methods based on statistical analysis and machine learning models mainly treat asset indicators as time series data. For example, time series models based on statistical analysis include the Autoregressive Integrated Moving Average model (ARIMA) [3,18,19], Vector Autoregressive model (VAR) [4,20], Autoregressive Conditional Heteroskedasticity Model (ARCH), Generative Autoregressive Conditional Heteroskedasticity Model (GARCH) [5,21,22], etc. Even though these traditional methods are simple and convenient for use, they still face some restrictions when applied to financial market analysis. ARIMA and VAR rely on the assumption of linearity, which prevents them from capturing nonlinear and complex dynamics inherent in stock market data. ARCH and GARCH address some of the limitations of linear assumptions by introducing a dynamic structure for conditional variance, but their applicability remains limited in capturing higher-dimensional and complex nonlinear interactions in stock market data. Moreover, these models also impose strict stationarity requirements, necessitating transformations that can result in the loss of critical information.
- Machine learning models.Machine learning-based methods, such as Support Vector Machines (SVMs) [7,23,24], Decision Trees, random forests (RFs) [9], and artificial neural networks (ANNs) [25], are highly effective in capturing nonlinear patterns and have gained widespread use in financial market analysis. Vijh and Chandola [9] employed artificial neural networks (ANNs) and random forests (RFs) to predict the next-day closing prices of five companies from various sectors, achieving satisfactory performance as measured using the RMSE and MAPE. Aydin and Cavdar [25] compared the performance of VAR and an ANN in predicting the exchange rate of USD/TRY, gold prices, and BIST 100 index, while the results indicated that the ANN approach has superior performance in prediction capability than the VAR method. However, these models are also prone to overfitting, particularly due to the inherent randomness and uncertainty of market conditions, which can compromise their predictive performance. Additionally, traditional machine learning methods often find it difficult to automatically discover implicit features and rely on manual feature engineering to extract them [26].
- Deep Learning Models.In recent years, deep learning algorithms became a promising solution replacing mathematical models, especially convolutional neural networks (CNNs) [27,28,29], Recurrent Neural Networks (RNNs) [30,31]), Long Short-Term Memory (LSTM) networks [32], temporal convolution networks (TCNs) [11], and Gated Recurrent Units (GRUs) [31]. Deep neural networks can be considered nonlinear function approximators that are capable of mapping nonlinear functions [33]. Hoseinzade and Haratizadeh [27] proposed the CNNpred framework based on a convolutional neural network (CNN) to improve the accuracy of stock market prediction. Lu and Xu [34] proposed an effective Time Series Recurrent Neural Network (TRNN) for stock price prediction. Selvin [33] compared the predict results of a CNN, an RNN, and LSTM, and the CNN outperformed the RNN and LSTM on stock price data of three representative companies. Liu et al. [32] proposed an optimized ensemble model that combines an LSTM-based attention mechanism and a cyclic multidimensional gray model, utilizing multi-source heterogeneous data, yielding a smaller mean absolute error, Mean Absolute Percentage Error, and root mean squared error than other models. Saud and Shakya [31] utilized an RNN, LSTM, and GRU for predicting the stock prices of the two most popular and strongest commercial banks listed on the Nepal Stock Exchange (NEPSE). Chen et al. [35] proposed iTCN with a multi-kernel parallel convolution structure within a residual layout at the core of a temporal convolution module, to address the low efficiency of the traditional TCN’s single kernel convolution in extracting temporal features from input sequences at different time scales.
2.2. Time Series Decomposition and Stock Price Prediction
2.3. Intrinsic Correlation Research in Stock Price Prediction
2.4. Graph Neural Network in Stock Price Prediction
2.5. Graph Attention Mechanism and Stock Price Prediction
3. System Framework
3.1. Seasonal–Trend Decomposition Based on Loess
- 1.
- Long-term Trends: The trend component reflects the long-term directional movement of stock prices, capturing factors such as company fundamentals, market sentiment, and broader economic cycles. It represents the underlying value changes of a stock over an extended period, smoothing out short-term fluctuations to reveal the overall trajectory—whether upward, downward, or sideways.
- 2.
- Cyclical patterns: The seasonal component captures the periodic fluctuations in stock prices, highlighting patterns that repeat at regular intervals. These fluctuations are often driven by time-related factors such as quarterly earnings reports, annual holidays, or monthly economic data releases. By isolating these cyclical patterns, the seasonal component helps identify predictable market behaviors tied to specific timeframes.
- 3.
- Irregular fluctuations: The residual component represents the random noise and unpredictable events in the stock market, including sudden market shocks, unexpected news, or shifts in investor sentiment. While it is an important feature of the market, its inherent unpredictability makes it challenging to model or forecast. After separating the trend and seasonal components, the residual must be decomposed and retained to account for the impact of these irregular and often significant market movements, ensuring a more comprehensive understanding of stock price dynamics.
3.1.1. Loess
3.1.2. Cycling Steps
- 1.
- Detrending: Obtain the detrended time series D:
- 2.
- Cycle Subseries Smoothing: Divide D from Step 1 into cycle subseries and regress them using LOESS. The result is denoted as .
- 3.
- Low-Pass Filtering: Apply a low-pass filter consisting of three steps:
- A moving average of length n;
- A moving average of length 3;
- A Loess regression with and .
The result is denoted as . - 4.
- Obtaining Seasonal Components: Compute the seasonal series by subtracting low-pass components:
- 5.
- Deseasonalizing: Obtain the deseasonalized series by subtracting the seasonal component S from the original series Y.
- 6.
- Trend Smoothing: Apply Loess regression to the result of Step 5 to obtain the trend series .
- 1.
- Execute the inner loop.
- 2.
- Calculate residual component :
- 3.
- Calculate robustness weight :The bisquare weight function is defined as
3.2. Asset Correlation
3.3. Spatial–Temporal Graph Attention Neural Network
3.3.1. GAT Module Based on Residual Mechanism
3.3.2. TCN Module Based on Residual Mechanism
3.4. Portfolio Establishment
4. Experiments
4.1. Datasets and Experimental Setup
4.2. Dataset Settings
- Method I: Dividing the original dataset into a 9:1 ratio based on the time range. The test set is defined as the continuous trading days between September 2023 and April 2024. The performance of the portfolio during this fixed time period is compared with the real index and actual performance of each investment portfolio.
- Method II: This method uses a simulation environment where 10% of non-continuous trading days are randomly selected from the overall dataset’s time range as the testing interval. This approach simulates the unpredictable nature of financial markets and helps evaluate the portfolio in different market conditions, ensuring that the model can handle diverse trends in the stock market.
4.3. Experimental Results
4.3.1. Predictive Performance of STGAT
4.3.2. Performance of Portfolio Optimization Results
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Steinbach, M.C. Markowitz revisited: Mean-variance models in financial portfolio analysis. SIAM Rev. 2001, 43, 31–85. [Google Scholar] [CrossRef]
- Black, F.; Litterman, R. Asset allocation: Combining investor views with market equilibrium. Goldman Sachs Fixed Income Res. 1990, 115, 7–18. [Google Scholar] [CrossRef]
- 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] [CrossRef]
- Vector Autoregressive Models for Multivariate Time Series. In Modeling Financial Time Series with S-PLUS®; Zivot, E., Wang, J., Eds.; Springer: New York, NY, USA, 2006; pp. 385–429. [Google Scholar] [CrossRef]
- Asai, M.; McAleer, M. A Portfolio Index GARCH model. Int. J. Forecast. 2008, 24, 449–461. [Google Scholar] [CrossRef]
- Su, H.; Wang, X.; Qin, Y.; Chen, Q. Attention based adaptive spatial–temporal hypergraph convolutional networks for stock price trend prediction. Expert Syst. Appl. 2024, 238, 121899. [Google Scholar] [CrossRef]
- Ince, H.; Trafalis, T.B. Kernel principal component analysis and support vector machines for stock price prediction. IIE Trans. 2007, 39, 629–637. [Google Scholar] [CrossRef]
- Basak, S.; Kar, S.; Saha, S.; Khaidem, L.; Dey, S.R. Predicting the direction of stock market prices using tree-based classifiers. N. Am. J. Econ. Financ. 2019, 47, 552–567. [Google Scholar] [CrossRef]
- Vijh, M.; Chandola, D.; Tikkiwal, V.A.; Kumar, A. Stock closing price prediction using machine learning techniques. Procedia Comput. Sci. 2020, 167, 599–606. [Google Scholar] [CrossRef]
- Waqar, M.; Dawood, H.; Guo, P.; Shahnawaz, M.B.; Ghazanfar, M.A. Prediction of Stock Market by Principal Component Analysis. In Proceedings of the 2017 13th International Conference on Computational Intelligence and Security (CIS), Hong Kong, 15–18 December 2017; pp. 599–602. [Google Scholar] [CrossRef]
- Lea, C.; Flynn, M.D.; Vidal, R.; Reiter, A.; Hager, G.D. Temporal Convolutional Networks for Action Segmentation and Detection. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 1003–1012. [Google Scholar] [CrossRef]
- Gao, J.; Ying, X.; Xu, C.; Wang, J.; Zhang, S.; Li, Z. Graph-Based Stock Recommendation by Time-Aware Relational Attention Network. ACM Trans. Knowl. Discov. Data 2021, 16, 1–21. [Google Scholar] [CrossRef]
- Xiang, S.; Cheng, D.; Shang, C.; Zhang, Y.; Liang, Y. Temporal and heterogeneous graph neural network for financial time series prediction. In Proceedings of the 31st ACM International Conference on Information & Knowledge Management, Atlanta, GA, USA, 17–21 October 2022; pp. 3584–3593. [Google Scholar]
- Jafari, A.; Haratizadeh, S. GCNET: Graph-based prediction of stock price movement using graph convolutional network. Eng. Appl. Artif. Intell. 2022, 116, 105452. [Google Scholar] [CrossRef]
- Zhang, J.; Liu, Z. Interval prediction of crude oil spot price volatility: An improved hybrid model integrating decomposition strategy, IESN and ARIMA. Expert Syst. Appl. 2024, 252, 124195. [Google Scholar] [CrossRef]
- Gong, J.; Qu, Z.; Zhu, Z.; Xu, H. Parallel TimesNet-BiLSTM model for ultra-short-term photovoltaic power forecasting using STL decomposition and auto-tuning. Energy 2025, 320, 135286. [Google Scholar] [CrossRef]
- Stasiak, M.D.; Staszak, Z.; Siwek, J.; Wojcieszak, D. Application of State Models in a Binary–Temporal Representation for the Prediction and Modelling of Crude Oil Prices. Energies 2025, 18, 691. [Google Scholar] [CrossRef]
- Mondal, P.; Shit, L.; Goswami, S. Study of Effectiveness of Time Series Modeling (Arima) in Forecasting Stock Prices. Int. J. Comput. Sci. Eng. Appl. 2014, 4, 13–29. [Google Scholar] [CrossRef]
- Khanderwal, S.; Mohanty, D. Stock price prediction using ARIMA model. Int. J. Mark. Hum. Resour. Res. 2021, 2, 98–107. [Google Scholar] [CrossRef]
- Suharsono, A.; Aziza, A.; Pramesti, W. Comparison of vector autoregressive (VAR) and vector error correction models (VECM) for index of ASEAN stock price. In Proceedings of the AIP Conference Proceedings, Provo, UT, USA, 16–21 July 2017; AIP Publishing: Melville, NY, USA, 2017; Volume 1913. [Google Scholar]
- Gabriel, A.M.; Ugochukwu, W.M. Volatility estimation and stock price prediction in the Nigerian stock market. Int. J. Financ. Res. 2012, 3, 2. [Google Scholar] [CrossRef]
- Alam, M.Z.; Siddikee, M.N.; Masukujjaman, M. Forecasting volatility of stock indices with ARCH model. Int. J. Financ. Res. 2013, 4, 126. [Google Scholar] [CrossRef]
- Fenghua, W.; Jihong, X.; Zhifang, H.; Xu, G. Stock price prediction based on SSA and SVM. Procedia Comput. Sci. 2014, 31, 625–631. [Google Scholar] [CrossRef]
- Heo, J.; Yang, J.Y. Stock price prediction based on financial statements using SVM. Int. J. Hybrid Inf. Technol. 2016, 9, 57–66. [Google Scholar] [CrossRef]
- Aydin, A.D.; Cavdar, S.C. Comparison of Prediction Performances of Artificial Neural Network (ANN) and Vector Autoregressive (VAR) Models by Using the Macroeconomic Variables of Gold Prices, Borsa Istanbul (BIST) 100 Index and US Dollar-Turkish Lira (USD/TRY) Exchange Rates. Procedia Econ. Financ. 2015, 30, 3–14. [Google Scholar] [CrossRef]
- Rezaei, H.; Faaljou, H.; Mansourfar, G. Stock price prediction using deep learning and frequency decomposition. Expert Syst. Appl. 2021, 169, 114332. [Google Scholar] [CrossRef]
- Hoseinzade, E.; Haratizadeh, S. CNNpred: CNN-based stock market prediction using a diverse set of variables. Expert Syst. Appl. 2019, 129, 273–285. [Google Scholar] [CrossRef]
- Cheng, P.; Xia, M.; Wang, D.; Lin, H.; Zhao, Z. Transformer Self-Attention Change Detection Network with Frozen Parameters. Appl. Sci. 2025, 15, 3349. [Google Scholar] [CrossRef]
- Xu, Z.; Wang, Y.; Feng, X.; Wang, Y.; Li, Y.; Lin, H. Quantum-enhanced forecasting: Leveraging quantum gramian angular field and CNNs for stock return predictions. Financ. Res. Lett. 2024, 67, 105840. [Google Scholar] [CrossRef]
- Pawar, K.; Jalem, R.S.; Tiwari, V. Stock market price prediction using LSTM RNN. In Proceedings of the Emerging Trends in Expert Applications and Security: Proceedings of ICETEAS 2018; Springer: Berlin/Heidelberg, Germany, 2019; pp. 493–503. [Google Scholar]
- Saud, A.S.; Shakya, S. Analysis of look back period for stock price prediction with RNN variants: A case study on banking sector of NEPSE. Procedia Comput. Sci. 2020, 167, 788–798. [Google Scholar] [CrossRef]
- Liu, Q.; Hu, Y.; Liu, H. Enhanced stock price prediction with optimized ensemble modeling using multi-source heterogeneous data: Integrating LSTM attention mechanism and multidimensional gray model. J. Ind. Inf. Integr. 2024, 42, 100711. [Google Scholar] [CrossRef]
- Selvin, S.; Vinayakumar, R.; Gopalakrishnan, E.A.; Menon, V.K.; Soman, K.P. Stock price prediction using LSTM, RNN and CNN-sliding window model. In Proceedings of the 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Udupi, India, 13–16 September 2017; pp. 1643–1647. [Google Scholar] [CrossRef]
- Lu, M.; Xu, X. TRNN: An efficient time-series recurrent neural network for stock price prediction. Inf. Sci. 2024, 657, 119951. [Google Scholar] [CrossRef]
- Chen, W.; An, N.; Jiang, M.; Jia, L. An improved deep temporal convolutional network for new energy stock index prediction. Inf. Sci. 2024, 682, 121244. [Google Scholar] [CrossRef]
- Zarnowitz, V.; Ozyildirim, A. Time series decomposition and measurement of business cycles, trends and growth cycles. J. Monet. Econ. 2006, 53, 1717–1739. [Google Scholar] [CrossRef]
- Wei, L.Y. A hybrid ANFIS model based on empirical mode decomposition for stock time series forecasting. Appl. Soft Comput. 2016, 42, 368–376. [Google Scholar] [CrossRef]
- Xu, C.; Zhao, X.; Wang, Y. Causal decomposition on multiple time scales: Evidence from stock price-volume time series. Chaos Solitons Fractals 2022, 159, 112137. [Google Scholar] [CrossRef]
- Tao, Z.; Wu, W.; Wang, J. Series decomposition Transformer with period-correlation for stock market index prediction. Expert Syst. Appl. 2024, 237, 121424. [Google Scholar] [CrossRef]
- Singh, S.; Singh, M.; Attri, S. Mapping stock market dynamics: A tripartite neural network approach using modified grid search for stock market prediction. Expert Syst. Appl. 2025, 278, 127243. [Google Scholar] [CrossRef]
- Preis, T.; Kenett, D.Y.; Stanley, H.E.; Helbing, D.; Ben-Jacob, E. Quantifying the behavior of stock correlations under market stress. Sci. Rep. 2012, 2, 752. [Google Scholar] [CrossRef] [PubMed]
- Pollet, J.M.; Wilson, M. Average correlation and stock market returns. J. Financ. Econ. 2010, 96, 364–380. [Google Scholar] [CrossRef]
- Song, D.M.; Tumminello, M.; Zhou, W.X.; Mantegna, R.N. Evolution of worldwide stock markets, correlation structure, and correlation-based graphs. Phys. Rev. E 2011, 84, 026108. [Google Scholar] [CrossRef]
- Patel, M.; Jariwala, K.; Chattopadhyay, C. A Systematic Review on Graph Neural Network-based Methods for Stock Market Forecasting. ACM Comput. Surv. 2024, 57, 1–38. [Google Scholar] [CrossRef]
- Yin, T.; Liu, C.; Ding, F.; Feng, Z.; Yuan, B.; Zhang, N. Graph-based stock correlation and prediction for high-frequency trading systems. Pattern Recognit. 2022, 122, 108209. [Google Scholar] [CrossRef]
- Huang, W.C.; Chen, C.T.; Lee, C.; Kuo, F.H.; Huang, S.H. Attentive gated graph sequence neural network-based time-series information fusion for financial trading. Inf. Fusion 2023, 91, 261–276. [Google Scholar] [CrossRef]
- 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]
- 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, Angeles, CA, USA, 5–9 February 2018; pp. 261–269. [Google Scholar]
- Velickovic, P.; Cucurull, G.; Casanova, A.; Romero, A.; Liò, P.; Bengio, Y. Graph Attention Networks. 2018. Available online: http://arxiv.org/abs/1710.10903 (accessed on 16 February 2018).
- Lei, Z.; Zhang, C.; Xu, Y.; Li, X. DR-GAT: Dynamic routing graph attention network for stock recommendation. Inf. Sci. 2024, 654, 119833. [Google Scholar] [CrossRef]
- Li, G.; Zhang, A.; Zhang, Q.; Wu, D.; Zhan, C. Pearson Correlation Coefficient-Based Performance Enhancement of Broad Learning System for Stock Price Prediction. IEEE Trans. Circuits Syst. II Express Briefs 2022, 69, 2413–2417. [Google Scholar] [CrossRef]
- Rungskunroch, P.; Shen, Z.J.; Kaewunruen, S. Benchmarking Socio-Economic Impacts of High-Speed Rail Networks Using K-Nearest Neighbour and Pearson’s Correlation Coefficient Techniques through Computational Model-Based Analysis. Appl. Sci. 2022, 12, 1520. [Google Scholar] [CrossRef]
- Zhan, Z.; Ren, H.; Xia, M.; Lin, H.; Wang, X.; Li, X. AMFNet: Attention-Guided Multi-Scale Fusion Network for Bi-Temporal Change Detection in Remote Sensing Images. Remote. Sens. 2024, 16, 1765. [Google Scholar] [CrossRef]
- Wang, Z.; Gu, G.; Xia, M.; Weng, L.; Hu, K. Bitemporal Attention Sharing Network for Remote Sensing Image Change Detection. IEEE J. Sel. Top. Appl. Earth Obs. Remote. Sens. 2024, 17, 10368–10379. [Google Scholar] [CrossRef]
- Zhu, T.; Zhao, Z.; Xia, M.; Huang, J.; Weng, L.; Hu, K.; Lin, H.; Zhao, W. FTA-Net: Frequency-Temporal-Aware Network for Remote Sensing Change Detection. IEEE J. Sel. Top. Appl. Earth Obs. Remote. Sens. 2025, 18, 3448–3460. [Google Scholar] [CrossRef]
- Jiang, S.; Lin, H.; Ren, H.; Hu, Z.; Weng, L.; Xia, M. MDANet: A High-Resolution City Change Detection Network Based on Difference and Attention Mechanisms under Multi-Scale Feature Fusion. Remote. Sens. 2024, 16, 1387. [Google Scholar] [CrossRef]
Market Index | Stock Count | Trading Days | Train Dataset | Test Dataset |
---|---|---|---|---|
CSI500 | 304 | 2170 | 1953 | 217 |
S&P500 | 462 | 2330 | 2097 | 233 |
Indicators | Formula | Meaning |
---|---|---|
MAE | Average of absolute errors between predicted and actual values | |
DA | Proportion of correct directional predictions where and | |
RE | Ratio of absolute error to the actual value | |
RMSE | Square root of MSE, in the same units as the target variable | |
R2 | Proportion of variance explained by the model |
Model | MAE | DA% | RE | RMSE | R2 | Accuracy |
---|---|---|---|---|---|---|
GCN | 3.6217 | 51.42% | 0.2701 | 5.6336 | 0.7765 | 0.5406 |
GRU | 2.0720 | 53.12% | 0.1290 | 3.9610 | 0.8895 | 0.6034 |
LSTM | 2.8745 | 51.11% | 0.1707 | 5.2883 | 0.8030 | 0.5768 |
MLP | 2.3909 | 51.47% | 0.1662 | 4.1556 | 0.8784 | 0.5702 |
RNN | 2.2594 | 52.70% | 0.1362 | 4.2614 | 0.8721 | 0.5941 |
TCN | 2.4904 | 51.13% | 0.1737 | 4.3004 | 0.8697 | 0.6156 |
Transformer | 3.0561 | 53.21% | 0.1878 | 5.2780 | 0.8018 | 0.5845 |
STGAT | 1.5064 | 53.85% | 0.0946 | 2.6312 | 0.9460 | 0.6445 |
Model | MAE | DA | RE | RMSE | R2 | Accuracy |
---|---|---|---|---|---|---|
GCN | 2.9273 | 54.20% | 0.2405 | 4.9487 | 0.7544 | 0.5760 |
GRU | 0.8597 | 61.71% | 0.0659 | 1.4769 | 0.9796 | 0.7367 |
LSTM | 1.0651 | 59.62% | 0.0791 | 1.9539 | 0.9643 | 0.7146 |
MLP | 1.1231 | 56.11% | 0.0878 | 1.8872 | 0.9643 | 0.7143 |
RNN | 0.8785 | 62.80% | 0.0679 | 1.5475 | 0.9776 | 0.7331 |
TCN | 0.8820 | 60.62% | 0.0727 | 1.4076 | 0.9801 | 0.7075 |
Transformer | 1.7136 | 57.20% | 0.1338 | 2.8327 | 0.9195 | 0.6233 |
STGAT | 0.8440 | 62.77% | 0.0682 | 1.3349 | 0.9821 | 0.7443 |
Model | MAE | DA | RE | RMSE | R2 | Accuracy |
---|---|---|---|---|---|---|
GCN | 17.4906 | 50.18% | 0.2260 | 34.4920 | 0.5802 | 0.5536 |
GRU | 12.6075 | 49.19% | 0.1385 | 30.8219 | 0.6645 | 0.5639 |
LSTM | 15.5489 | 48.66% | 0.1812 | 33.4528 | 0.6051 | 0.5604 |
MLP | 13.8276 | 49.75% | 0.1760 | 28.7233 | 0.7089 | 0.5595 |
RNN | 16.7846 | 49.34% | 0.2108 | 34.7371 | 0.5743 | 0.5548 |
TCN | 13.9017 | 49.26% | 0.1933 | 28.7784 | 0.7078 | 0.5580 |
Transformer | 19.0230 | 47.77% | 0.2185 | 36.7984 | 0.5222 | 0.5158 |
STGAT | 10.5988 | 49.33% | 0.1079 | 29.3184 | 0.7555 | 0.5734 |
Model | MAE | DA | RE | RMSE | R2 | Accuracy |
---|---|---|---|---|---|---|
GCN | 8.6079 | 52.13% | 0.1604 | 16.5780 | 0.8476 | 0.5989 |
GRU | 4.3827 | 59.82% | 0.0763 | 7.4141 | 0.9655 | 0.7179 |
LSTM | 5.3500 | 54.65% | 0.0870 | 11.0945 | 0.9317 | 0.6802 |
MLP | 3.9639 | 54.35% | 0.0670 | 6.1679 | 0.9761 | 0.7269 |
RNN | 4.6009 | 54.46% | 0.0798 | 8.0679 | 0.9591 | 0.7065 |
TCN | 3.7263 | 56.08% | 0.0719 | 5.4170 | 0.9815 | 0.7352 |
Transformer | 10.3493 | 54.42% | 0.1807 | 19.6812 | 0.7852 | 0.6128 |
STGAT | 2.9266 | 61.78% | 0.0492 | 4.5396 | 0.9885 | 0.7714 |
Indicators | Formula | Meaning |
---|---|---|
Cumulative Return | Total return of the portfolio | |
Volatility (V) | Fluctuation range of stock prices | |
Sharpe Ratio | Additional return per unit of deviation | |
Maximum Drawdown (MDD) | Maximum loss from peak to trough before new peak | |
Calmar Ratio | Ratio of annualized return to maximum drawdown | |
Information Ratio | Excess return per unit of tracking error | |
Treynor Ratio | Risk premium per unit of systematic risk |
Model | Cumulative Return | Volatility | Sharpe Ratio | Max Drawdown | Calmar Ratio | Information Ratio | Treynor Ratio |
---|---|---|---|---|---|---|---|
CSI500 | −5.76% | 0.1552 | −0.7878 | 13.68% | −0.8069 | - | −0.1222 |
GCN | 11.52% | 0.2150 | 1.3166 | 10.99% | 2.6832 | 0.4645 | 0.2363 |
GRU | 7.28% | 0.2198 | 0.8178 | 13.49% | 1.4208 | 0.3365 | 0.1497 |
LSTM | 11.51% | 0.2230 | 1.2774 | 13.43% | 2.2095 | 0.4328 | 0.2319 |
MLP | 8.00% | 0.1979 | 0.9689 | 11.02% | 1.8476 | 0.4659 | 0.1698 |
RNN | 18.78% | 0.2096 | 2.2460 | 8.62% | 5.5977 | 0.6108 | 0.4161 |
TCN | 2.65% | 0.2138 | 0.3266 | 14.35% | 0.5695 | 0.2819 | 0.0556 |
Transformer | 7.48% | 0.2170 | 0.8471 | 11.94% | 1.6391 | 0.4629 | 0.1399 |
STGAT | 28.21% | 0.2582 | 2.9279 | 10.10% | 7.6034 | 0.5752 | 0.5771 |
Model | Cumulative Return | Volatility | Sharpe Ratio | Max Drawdown | Calmar Ratio | Information Ratio | Treynor Ratio |
---|---|---|---|---|---|---|---|
S&P500 | 20.16% | 0.1179 | 3.9280 | 4.73% | 10.0456 | - | 0.4631 |
GCN | 26.08% | 0.2673 | 2.4776 | 7.68% | 8.7771 | 0.0849 | 0.4403 |
GRU | 23.98% | 0.2381 | 2.4938 | 9.42% | 6.4303 | 0.0590 | 0.5473 |
LSTM | 16.77% | 0.2686 | 1.5486 | 10.00% | 4.2790 | −0.0212 | 0.2874 |
MLP | 32.42% | 0.2244 | 3.6718 | 7.28% | 11.4829 | 0.1745 | 0.6852 |
RNN | 19.86% | 0.2539 | 1.9307 | 10.31% | 4.8712 | 0.0121 | 0.3990 |
TCN | 16.12% | 0.1784 | 2.0939 | 7.00% | 5.5078 | −0.0476 | 0.8754 |
Transformer | 25.71% | 0.2602 | 2.4944 | 7.68% | 8.6104 | 0.0786 | 0.4885 |
STGAT | 36.87% | 0.2306 | 4.1513 | 6.57% | 14.7553 | 0.2197 | 0.8031 |
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. |
© 2025 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
Feng, R.; Jiang, S.; Liang, X.; Xia, M. STGAT: Spatial–Temporal Graph Attention Neural Network for Stock Prediction. Appl. Sci. 2025, 15, 4315. https://doi.org/10.3390/app15084315
Feng R, Jiang S, Liang X, Xia M. STGAT: Spatial–Temporal Graph Attention Neural Network for Stock Prediction. Applied Sciences. 2025; 15(8):4315. https://doi.org/10.3390/app15084315
Chicago/Turabian StyleFeng, Ruizhe, Shanshan Jiang, Xingyu Liang, and Min Xia. 2025. "STGAT: Spatial–Temporal Graph Attention Neural Network for Stock Prediction" Applied Sciences 15, no. 8: 4315. https://doi.org/10.3390/app15084315
APA StyleFeng, R., Jiang, S., Liang, X., & Xia, M. (2025). STGAT: Spatial–Temporal Graph Attention Neural Network for Stock Prediction. Applied Sciences, 15(8), 4315. https://doi.org/10.3390/app15084315