Abstract

Stock is a significant component of financial market so that prediction of stock prices has always been a hot topic in the field of financial research. Nowadays, traditional financial models for prediction are confronted with problems of low accuracy and stability. In order to solve the above problems, the article uses LSTM model to predict American AT&T company's stock closing prices and then utilizes attention mechanism to optimize LSTM model (LSTM-Attention). In addition, by comparing LSTM, Transformer and LSTM-Attention models, it is discovered that attention mechanism is superior than traditional deep leaning models in the aspect of predicting stock prices. The experiment shows that LSTM-Attention‘s accuracy is higher than LSTM by 8.13% and its RMSE is lower than LSTM by 5.31 %. Meanwhile, Transformer's accuracy is higher than LSTM by 4.68% and its RMSE is lower than LSTM by 2.91 %. Therefore, models based on attention mechanism are better at prediction than LSTM and the difference between LSTM-Attention and Transformer is insignificant. The method in this article is supported to be with high effectiveness, which plays a crucial role in prediction of stock prices in the financial field.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call