Predicting Future Stock Price with Sentiment Analysis: Recurrent vs. Attention Based Learning for Regression Tasks
Date
2023-08
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
University of the Witwatersrand, Johannesburg
Abstract
Stock price prediction is a lucrative challenge as successful prediction could yield significant profits for investors – attracting research utilising novel data sources and modelling techniques. This research aimed to accurately predict the future closing price of the top five stocks of the NASDAQ100 index by leveraging Twitter data and recent advancements in machine learning. Three representations of large-scale Twitter data were derived: company, stock market, and general public sentiment. Company sentiment and stock market sentiment were Granger-causal (p < 0.10) for the closing price of four and two of the five companies considered, respectively. Five stock price prediction models were built: ARIMA, RNN, LSTM, GRU, and a novel Transformer model. A hyperparameter grid search selected feature subsets containing sentiment data as optimal in sixteen of the twenty (80%) model-dataset combinations fitted. Assessed using the RMSE, all the machine learning models outperformed the ARIMA model. The attention-based Transformer model outperformed the recurrent models in both predictive performance and model computational training efficiency. The model produced test RMSEs of 1.22, 2.07, 35.54, 16.61, and 4.95 when predicting the closing price of Apple, Microsoft, Amazon, Alphabet, and Facebook respectively.
Description
This dissertation is submitted for the degree of Master of Science, to the Faculty of Science, School of Statistics and Actuarial Science, University of the Witwatersrand, Johannesburg, 2023.
Keywords
Stock price, Reccurent, Attention Based Learning, ARIMA model, UCTD
Citation
Mcdonald, Bernard. (2023). Predicting Future Stock Price with Sentiment Analysis: Recurrent vs. Attention Based Learning for Regression Tasks. [Master's dissertation, University of the Witwatersrand, Johannesburg]. https://hdl.handle.net/10539/42615