Estimation of Stock Price Using LSTM Algorithm and Sentiment Analysis
DOI:
https://doi.org/10.26713/cma.v15i2.2595Keywords:
Stock price prediction, Convolutional Neural Network, Training, LSTM, Sentiment analysis, Deep learningAbstract
Predicting price of the stock is a complex job and it is almost impossible to predict the exact amount of the stock. However, it’s possible to estimate future amount of the stock through searching at historical information. There are various machine learning models available with which stock price can be estimated. In this paper, initially a detailed survey is presented that is based on a comparison and examination of various deep learning algorithms for estimation of stock price. It includes Linear Regression, Support Vector Machine, Auto Regressive Integrated Moving Average, Convolutional Neural Network, Long Short-Term Memory, Artificial Neural network. It is observed that the LSTM algorithm has a better performance as compared to the others. In this work a univariate model is trained to estimate the price of the stock using LSTM model. To improve the results further a sentiment analysis based on twitter data is performed and a multivariate LSTM model is trained. The results presented in this work are based on three stocks Britannia, HDFC bank and Axis bank. The state-of-the-art natural language processing tool BERT are used to recognize the sentiments of text, and the long short term memory neural network (LSTM), which is good at analyzing time series data, is applied to forecast the stock price with stock historical transaction information and text sentiments The various performance parameters are also discussed in this paper. The analysis is performed based on changing number of epochs and it is observed that error percentage reduced with increasing number of epochs.
Downloads
References
A. A. Adebiyi, A. O. Adewumi and C. K. Ayo, Comparison of ARIMA and artificial neural networks models for stock price prediction, Journal of Applied Mathematics 2014 (2014), Article ID 614342, 7 pages, DOI: 10.1155/2014/614342.
H. Ahuja, S. Mehra, G. Manju, D. Aishwarya and Y. Bhavaraju, Stock price prediction using SVM and LSTM, International Research Journal of Engineering and Technology 7(7) (2020), 4963 – 4968.
O. El Aissaoui, Y. El Alami El Madani, L. Oughdir, A. Dakkak and Y. El Allioui, A multiple linear regression-based approach to predict student performance, in: Advanced Intelligent Systems for Sustainable Development (AI2SD’2019), M. Ezziyyani (ed.), Advances in Intelligent Systems and Computing, Vol. 1102. Springer, Cham., DOI: 10.1007/978-3-030-36653-7_2.
T. T. Chitenderu, A. Maredza and K. Sibanda, The random walk theory and stock prices: evidence from Johannesburg stock exchange, International Business & Economics Research Journal 13 (6) (2014), 1241 – 1250, DOI: 10.19030/iber.v13i6.8918.
T. T.-L. Chong and W.-K. Ng, Technical analysis and the London stock exchange: Testing the MACD and RSI rules using the FT30, Applied Economics Letters 15(14) (2008), 1111 – 1114, DOI: 10.1080/13504850600993598.
N. Darapaneni, A.R. Paduri, H. Sharma, M. Manjrekar, N. Hindlekar, P. Bhagat, U. Aiyer and Y. Agarwal, Stock price prediction using sentiment analysis and deep learning for Indian markets, arXivpreprint arXiv:2204.05783 (2022), DOI: 10.48550/arXiv.2204.05783.
R. Gupta and M. Chen, Sentiment analysis for stock price prediction, in: 2020 IEEE Conference on Multimedia Information Processing and Retrieval (MIPR), Shenzhen, China (2020), pp. 213 – 218, DOI: 10.1109/MIPR49039.2020.00051.
A. Gupta and T. Nagalakshmi, Stock price prediction using linear regression in machine learning, International Journal of Innovative Technology and Exploring Engineering 8(12) (2019), 1382 – 1385, DOI: 10.35940/ijitee.L3932.1081219.
V. Gururaj, V. R. Shriya and K. Ashwini, Stock market prediction using linear regression and support vector machines, International Journal of Applied Engineering Research 14(8) (2019), 1931 – 1934.
E. Hoseinzade and S. Haratizadeh, CNNpred: CNN-based stock market prediction using a diverse set of variables, Expert Systems with Applications 129(2019), 273 – 285, DOI: 10.1016/j.eswa.2019.03.029.
M. Khashei and M. Bijari, An artificial neural network (p,d, q) model for timeseries forecasting, Expert Systems with Applications 37(1) (2010), 479 – 489, DOI: 10.1016/j.eswa.2009.05.044.
S. K. Lakshminarayanan and J. McCrae, A comparative study of SVM and LSTM deep learning algorithms for stock market prediction, in: CEUR Workshop Proceedings – AICS Volume 2563, pp. 446 – 457 (2019), URL: https://ceur-ws.org/Vol-2563/aics_41.pdf.
L. Li, Y. Wu, Y. Ou, Q. Li, Y. Zhou and D. Chen, Research on machine learning algorithms and feature extraction for time series, in: IEEE 28th Annual International Symposium on Personal, Indoor, and Mobile Radio Communications (PIMRC2017) Montreal, QC, Canada,2017, pp. 1 – 5 (2017), DOI: 10.1109/PIMRC.2017.8292668.
A. Liaw and M. Wiener, Classification and regression by randomForest, R News 2-3 (2002), 18 – 22.
Q. Ma, Comparison of ARIMA, ANN and LSTM for stock price prediction, in: E3S Web of Conferences, 2020 International Symposium on Energy, Environmental Science and Engineering (ISEESE 2020), Vol. 218, (2020), Article Number: 01026, DOI: 10.1051/e3sconf/202021801026.
S. Madge, Predicting stock price direction using support vector machines, Independent Work Report Spring – 2015, Department of Computer Science, Princeton University, Princeton, 14 pages (2015), URL: https://www.cs.princeton.edu/sites/default/files/uploads/saahil_madge.pdf.
S. Mehtab and J. Sen, A robust predictive model for stock price prediction using deep learning and natural language processing, in: Proceedings of the 2019 International Conference on Business Analytics and Intelligence (ICBAI 2019), December 2019, Bangalore, India (2019).
A. Meyler, G. Kenny and T. Quinn, Forecasting Irish inflation using ARIMA models, Research Technical Papers 3/RT/98, Central Bank and Financial Services Authority of Ireland, 46 pages (1998), URL: https://mpra.ub.uni-muenchen.de/11359/1/cbi_3RT98_inflationarima.pdf.
S. Mohan, S. Mullapudi, S. Sammeta, P. Vijayvergia and D. C. Anastasiu, Stock price prediction using news sentiment analysis, in: 2019 IEEE Fifth International Conference on Big Data Computing Service and Applications (BigDataService, Newark, CA, USA, 2019), pp. 205 – 208, (2019), DOI: 10.1109/BigDataService.2019.00035.
R. Nandakumar, K. R. Uttamraj, R. Vishal and Y. U. Lokeswari, Stock price prediction using long short-term memory, International Research Journal of Engineering and Technology 5(3) (2018), 3342 – 3348.
E. O. Oyeyemi, L.-A. McKinnell and A. W. V. Poole, Neural network-based prediction techniques for global modeling of M(3000)F2 ionospheric parameter, Advances in Space Research 39(5) (2007), 643 – 650, DOI: 10.1016/j.asr.2006.09.038.
B. Panwar, G. Dhuriya, P. Johri, S. S. Yadav and N. Gaur, Stock market prediction using linear regression and SVM, in: Proceedings of the 2021 International Conference on Advance Computing and Innovative Technologies in Engineering (ICACITE), Greater Noida, India, 4-5 March 2021, pp. 629 – 631, (2021).
G. G. Rajput and B. H. Kaular, A study of effect of training period duration and share split event on predicting stock price using neural networks, in: Proceedings of WRFER-IEEEFORUM International Conference, 21 May 2017, Pune, India, pp. 38 – 43 (2017), URL: https://www.digitalxplore.org/up_proc/pdf/305-149768102438-43.pdf.
J. Rasheed, A. Jamil, A. A. Hameed, M. Ilyas, A. Özyava¸s and N. Ajlouni, Improving stock prediction accuracy using CNN and LSTM, in: 2020 International Conference on Data Analytics for Business and Industry: Way Towards a Sustainable Economy (ICDABI), Sakheer, Bahrain (2020), pp. 1 – 5, DOI: 10.1109/ICDABI51230.2020.9325597.
G. A. F. Seber and A. J. Lee, Linear Regression Analysis, John Wiley & Sons, xvi + 565 pages (2003).
S. Siami-Namini, N. Tavakoli and A. S. Namin, A comparison of ARIMA and LSTM in forecasting time series, in: 2018 17th IEEE International Conference on Machine Learning and Applications (ICMLA), Orlando, FL, USA, 2018, pp. 1394 – 1401 (2018), DOI: 10.1109/ICMLA.2018.00227.
F. Sukesti, I. Ghozali, F. Fuad, A. K. Almasyhari and N. Nurcahyono, Factors affecting the stock price: The role of firm performance, The Journal of Asian Finance, Economics and Business 8(2) (2021), 165 – 173, URL: https://koreascience.kr/article/JAKO202104142178581.pdf.
R. Taneja and Vaibhav, Stock market prediction using regression, International Research Journal of Engineering and Technology 5(5) (2018), 813 – 815.
M. Vijh, D. Chandola, V. A. Tikkiwal and A. Kumar, Stock closing price prediction using machine learning techniques, Procedia Computer Science 167 (2020), 599 – 606, DOI: 10.1016/j.procs.2020.03.326.
G. W. R. I. Wijesinghe and R. M. K. T. Rathnayaka, ARIMA and ANN approach for forecasting daily stock price fluctuations of industries in Colombo Stock Exchange, Sri Lanka, in: 2020 5th International Conference on Information Technology Research (ICITR 2020), pp. 1 – 7 (2020), DOI: 10.1109/ICITR51448.2020.9310826.
G. P. Zhang, Time series forecasting using a hybrid ARIMA and neural network model, Neurocomputing 50 (2003), 159 – 175, DOI: 10.1016/S0925-2312(01)00702-0.
G. Zhang, B. E. Patuwo and M. Y. Hu, Forecasting with artificial neural networks: The state of the art, International Journal of Forecasting 14(1) (1998), 35 – 62, DOI: 10.1016/S0169-2070(97)00044-7.
Downloads
Published
How to Cite
Issue
Section
License
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a CCAL that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work.