Performance Comparison of LSTM and Transformer Models in Saudi Stock Market Prediction
摘要
This paper is mainly about a comparison of Long Short-Term Memory (LSTM) neural networks and Transformer models in predicting the stock prices in Saudi stock market. The aim of the study is to determine which model is better in predicting futures prices and therefore assist investors and analysts in decision making processes. It should also be noted that LSTMs are good in remembering historical sequences but Transformers do it even better utilizing attention mechanisms. The results clearly demonstrate that Transformer models have better prediction accuracy in all measures such as Mean Absolute Error MAE, Mean Squared Error MSE and Root Mean Square Error RMSE. For instance, on the Tadawul All Share Index TASI, the Transformer model achieved an MAE of 0.0177, against LSTM’s 0.0756. This research demonstrates the potential of using Transformer models for stock market forecasting and paves the way for future studies focused on creating hybrid models. For example, combining Transformers with external data, such as sentiment analysis of financial news and macroeconomic factors like interest rates and GDP, could improve prediction accuracy. Incorporating these additional sources of information is likely to strengthen the model’s ability to handle unknown future periods and enhance its overall performance.