School of Statistics and Actuarial Science (ETDs)
Permanent URI for this community
Browse
Browsing School of Statistics and Actuarial Science (ETDs) by Author "Nasejje, Justine"
Now showing 1 - 1 of 1
Results Per Page
Sort Options
Item Predicting Future Stock Price with Sentiment Analysis: Recurrent vs. Attention Based Learning for Regression Tasks(University of the Witwatersrand, Johannesburg, 2023-08) Mcdonald, Bernard; Nasejje, JustineStock 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.