# STGAT: Spatial-Temporal Graph Attention Neural Network for Stock Prediction
## 4 Experiments
### Experimental Results
#### 4.3.2 Performance of Portfolio Optimization Results  
To rigorously assess the effectiveness of STGAT in portfolio management, this study uses several indicators to evaluate both the risk and return of the portfolio. The indicators outlined in Table 7 aim to determine whether the portfolio's returns commensurate with the risks assumed. In Table 7, \((R_{1},R_{2},\ldots,R_{n})\) denotes the return rates from period 1 to period n, while \(E(R_{p})\) represents the expected value of the portfolio's return. The volatility of the portfolio return is indicated by \(V\), and \(R_{f}\) signifies the risk-free interest rate, which, in this context, is represented by the semi-annual interest rates on Chinese and US treasury bonds. Furthermore, \(\tau\) is the time index, \(\hat{P}_{t}\) represents the asset value at time \(t\), \(MDD\) stands for the portfolio's maximum drawdown, \(R_{b}\) is the benchmark return rate, \(\sigma_{p-b}\) indicates the standard deviation of the difference between portfolio returns and benchmark returns, and \(\beta\) is the systematic risk coefficient. As shown in Tables 8 and 9, STGAT shows better performance compared to the other models in terms of cumulative returns and Sharpe ratios, indicating its effectiveness in identifying market trends, assessing individual stock potential, and managing risk. These results underscore the practical value and effectiveness of STGAT in portfolio management. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Model** & **MAE** & **DA** & **RE** & **RMSE** & **R2** & **Accuracy** \\ \hline 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** \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparison of predictive performance of different models on US stock dataset (divided using method II). The bold indicates the best performance among all models. Figure 10: Partial prediction performance in US stock market. (**a**) Test 1; (**b**) Test 2; (**c**) Test 3; (**d**) Test 4; (**e**) Test 5; (**f**) Test 6. From the results presented in Tables 8 and 9, STGAT demonstrates a remarkable cumulative return, significantly outperforming other deep learning models with 28.21% in the A-share market and an even more impressive 36.87% in the US market. The volatility of all portfolio models in both markets remained within a stable range of approximately 0.1 to 0.3, reflecting consistent stability in both the A-share and US stock markets during the testing period. Such stability is particularly valuable for investors seeking reliable performance in inherently volatile environments. STGAT also excels in terms of the Sharpe ratio, achieving 2.93 in the A-share market and 4.15 in the US market. This further highlights its superior risk-return trade-off compared to the other models, indicating that STGAT not only generates higher returns but does so with relatively lower risk. Moreover, STGAT's maximum drawdown, at 6.57% in the A-share market, showcases its robust risk management capabilities. By effectively limiting potential losses, STGAT offers a safer investment alternative for risk-averse investors.The Calmar Ratio, which measures cumulative return per unit of maximum drawdown, was notably high for STGAT, standing at 7.60 in the A-share market and 14.76 in the US market. This metric reflects STGAT's ability to generate substantial returns while maintaining relatively lower risk levels. Additionally, STGAT's Information Ratio, at 0.22 in the A-share market and 0.58 in the US market, indicates its capacity to provide significant excess returns relative to the benchmark.