Predictive Modeling of Stock Prices Using Transformer Model
Abstract
Financial market prediction utilizing deep learning has attracted the attention of both investors and researchers. Deep learning methods, such as convolutional neural networks and recurrent neural networks work well at predicting stock indices based on the nonlinear characteristics of stock markets. The goal of this work is to predict the stock index using the latest deep learning framework, Transformer. This paper presents a comprehensive analysis of stock closing price prediction using three distinct machine learning models: Long Short-Term Memory (LSTM), Prophet, and Transformer. Using the encoder-decoder architecture and the multi-head attention mechanism, Transformer is able to better characterize stock market dynamics. The present study uses data from Yahoo Finance. The Transformer model demonstrated superior performance in comparison with LSTM and Prophet. In this work, we handle the complexities of market dynamics to improve stock price predictions