Ijraset Journal For Research in Applied Science and Engineering Technology
Authors: Meghana R, Shailaja K. P.
DOI Link: https://doi.org/10.22214/ijraset.2024.63696
Certificate: View Certificate
Prediction of stock prices calls for strong algorithmic foundations for predictions of greater magnitude in share prices because the stock market epitomizes volatility. There exist several models used for the prediction of stock prices. The Long Short-Term Memory algorithm is one model that seems well-suited for such time series problems. The key objective is to best predict current trends in the market and stock prices, which can be done through point prediction, scenario prediction, anomaly prediction, interval prediction, and volatility prediction. The objective of the study is to provide insight to investors and analysts to understand and predict the behavior of the stock market.
I. INTRODUCTION
The stock market is simply a concise fraction of the world's economy, providing a dynamic platform for the purchase and sale of shares in open companies to facilitate capital formation and offer investment opportunities globally. It is an important avenue for raising capital by companies for their development and innovation and provides people and organizations with ways to invest and create more wealth. No matter how important this may be, stock price prediction remains relatively tricky due to intrinsic complexity and market volatility. Investors always seek ways through which they can make informed decisions amidst this fluctuating market. Lately, methods incorporating cutting edge techniques in stock price forecasting, such as Long Short-Term Memory, have been viable.
Long Short-Term Memory, a category of Recurrent Neural Network, is hailed for the capability to learn from long-term dependencies. LSTM models can help an investor maneuver the volatility of the stock market and make wise investment decisions by pointing out trends from previous price data that are likely to predict future price movements.
Some key applications of LSTM on stock market prediction include point prediction, scenario analysis, interval prediction, volatility prediction, and anomaly detection. Much as interval prediction gives a range of possible price movements, volatility prediction projects the future volatility of a stock's prices and anomaly detection recognizes abnormal price movements, and point prediction gives the most probable future closing prices, all these tools put together give an insight into the market dynamics and help investors make informed decisions.
II. LITERATURE REVIEW
Stock price prediction has long been a difficult and important topic of research because to the possible financial benefits. Hochreiter and Schmidhuber (1997) [17] made substantial advances in this discipline by addressing the vanishing gradient problem in Recurrent Neural Networks (RNNs), making LSTM particularly suitable for time-series data such as stock prices. Numerous studies have now used LSTM for stock price prediction, confirming its usefulness and room for improvement.
Roondiwala et al. (2017) [7] showed that LSTM networks can detect complicated patterns in stock price fluctuations, outperforming established statistical methods. Selvin et al. (2017) [14] expanded on this strategy by combining LSTM with RNN and CNN models and improving predicted accuracy with a sliding window technique. Li et al. (2018) [4] added an attention mechanism to the LSTM model, considerably improving prediction performance by focusing on relevant regions of the input sequence.
Systematic reviews, such as that conducted by Kumar and Gandhmal (2019) [2], have demonstrated the superiority of LSTM over alternative stock market prediction methodologies. Different implementations and comparisons of LSTM models have also been investigated. For example, Zhang (2023) [12] experimented with various LSTM architectural factors to find optimal configurations that improve predicting performance. Li (2024) [16] and You (2024) [18] concentrated on hyperparameter optimization and model tuning, resulting in significant increases in predictive ability.
The integration of LSTM with other machine learning models has become a popular research topic. Zhang (2003) [13] used ARIMA and neural networks to achieve robust time-series forecasting by exploiting both linear and nonlinear modeling capabilities. Lawi et al. (2022) [15] applied LSTM and Gated Recurrent Units (GRUs) to grouped time-series data, demonstrating their ability at capturing temporal dependencies. Furthermore, Selvin et al. (2017) [14] proved the advantages of combining LSTM with CNN for better stock price prediction.
Empirical research on certain markets and equities have demonstrated the applicability of LSTM models. Ghosh et al. (2019) [9] applied LSTM to the Indian stock market and demonstrated its responsiveness to changing market conditions. Moghar and Hamiche (2020) [10] employed LSTM to predict stock values in a variety of scenarios, demonstrating its robustness. Pramod and Shastry (2020) [3] supported similar findings, emphasizing LSTM's capacity to model complicated stock price patterns.
Recent research has also focused on improving LSTM models by tackling specific difficulties. Ding (2023) [29] introduced a CNN-LSTM hybrid model that captures both spatial and temporal data, greatly boosting prediction accuracy. Qian (2023) [27] examined multiple LSTM-based approaches, indicating critical areas for improvement and future research paths. Lu (2024) [24] compared LSTM to linear models and random forests, demonstrating LSTM's higher performance in stock price prediction.
The usefulness of LSTM has been proved on a variety of datasets and financial instruments. Talati et al. (2022) [5] and Abubaker and Farid (2022) [11] found great accuracy in stock price predictions using LSTM, demonstrating its applicability across a wide range of market situations. Kulkarni et al. (2024) [8] and Hiba Sadia et al. (2019) [6] validated the model's ability to handle complex time-series data.
Further research has explored LSTM in various financial contexts. Zhang (2023) [12] applied LSTM to predict technology stock prices, showing significant improvements over traditional models . Li et al. (2022) [21] conducted a comparative study on Tesla's stock price prediction, highlighting the advantages of different LSTM variants . Moreover, Raut and Shrivas (2024) [22] analyzed different LSTM models for stock price prediction, providing insights into their relative performances .
Innovative approaches continue to emerge. Li (2024) [16] improved stock price prediction by studying various LSTM architectural characteristics, resulting in superior financial forecasting. Deshpande (2023) [19] used LSTM networks specifically for stock price prediction, with noteworthy results. Khofifahturizqi et al. (2024) [20] investigated the use of LSTM for predicting stock price volatility, which can aid in investing portfolio selection strategies.
The applicability of LSTM to diverse stocks and market scenarios has been further demonstrated. Chen (2023) [23] applied LSTM to machine learning-based stock price prediction, resulting in considerable accuracy gains. Tan (2024) [25] used machine learning techniques, including LSTM, to anticipate Nvidia's stock price, proving the model's adaptability. Diqi et al. (2024) [26] improved stock price prediction with a layered LSTM model, demonstrating significant performance increases. Furthermore, novel applications of LSTM models are also being investigated. For example, Huang (2023) suggested a methodology based on trend characterisation to improve prediction accuracy. Furthermore, the work of Li et al. (2023) on technology stocks demonstrated the model's flexibility across industries.
III. METHODOLOGIES
We have utilized the advantage of the Long Short-Term Memory, an RNN architecture aimed at mitigating the limitations of traditional RNNs in modeling long-term dependencies in sequential data. LSTMs have a high applicability in stock price prediction, natural language processing, time series analysis, and speech recognition.
A. How does LSTM Work?
Suppose While reading a story you depend on your ability to remember the essential details of the previous sentences to have a better understanding. Similarly, LSTM works by memorising relevant information from the previous time steps while processing the current input.
a. Input Gate: It decides with regard to the current input, what information is stored in the memory cell.
b. Forget Gate: How much of the information stored in the memory cell should be forgotten or deleted.
c. Output Gate: Through the output gate, it is decided what type of data needs to be transferred from the memory cell into the next time step.
3. Cell State: The self-internal state of the memory cell is the cell state itself, which enables the holding of information across very long sequences and thus helps prevent the vanishing gradient problem occurring in traditional RNN models.
4. Steps for Processing: An LSTM cell processes inputs at each time step according to the following steps:
a. Forget: A forget gate controlling the content of the cell state that needs to be flushed out, depending upon current input and previous cell state.
b. Input: An input gate that selects new information that has to be stored in a cell state depending on the current input and previous cell state.
c. Update: Working on a cell state by scrubbing some information and adding new data.
d. Output: It will determine, based on the current input and updated cell state, what information of the cell state it has to propagate to the next time step.
B. Dataset Description
In this research paper, We used real-time stock price datasets from four of the biggest tech companies in the world: Apple, Amazon, Google, and Microsoft. The information came from Yahoo Finance and covered the June 21, 2023, to June 21, 2024 time frame. A wide range of financial indicators required for stock price forecasting were included in this dataset. The dataset contained the following particular parameters:
These parameters are critical for making accurate predictions about the company's stock price for the day ahead. 70% of the data is being trained to make accurate predictions.
The above Figure 23 says, Mean Absolute Error: This value tells you that your model is about 29.68 units away from the actual data.
Mean squared error MSE and root Mean Squared Error RMSE: The MSE is an average of the squared differences between predicted and actual values; RMSE is the square root of it. An RMSE of 32.38 means your model's predictions are on average about 32.38 units away.
Mean Absolute Percentage Error: 12.52%. This tells you that, on average, the forecast is 12.52% away from the real value. MAPE can be looked upon more directly as a measure of accuracy, with lower percentages indicating greater accuracy.
The Accuracy of the model is: 87.48%
In conclusion, this research paper on stock price prediction using the LSTM algorithm reviews advanced techniques for time-series based forecasting of stock prices in this dynamic and volatile stock market. It will help the investors and analysts to learn with the current trends in the market and give them a better decision for stock investments using LSTM models. The study represents the importance of LSTM in capturing long-term dependencies of sequential data and offers different ways for prediction purposes, such as point prediction, scenario analysis, interval prediction, volatility prediction, and anomaly detection. The accuracy of the model is 87%, this paper contributes to the improvement of understanding market dynamics and helps in very informed decision-making associated with the stock market in general.
[1] S. Dinesh; A.M.S. Rama Raju; S. Rahul; O. Naga Sandeep, STOCK PRICE PREDICTION USING LSTM, ResearchGate – 2021. [2] K. Kumar; Dattatray P. Gandhmal, Systematic analysis and review of stock market prediction techniques, ScienceDirect – 2019 [3] Pramod B.S; Mallikarjuna Shastry, Stock Price Prediction Using LSTM, Test Engineering and Management 83(May-June 2020). [4] Hao Li; Yanyan Shen; Yanmin Zhu, Stock Price Prediction Using Attention-based Multi-Input LSTM, ACML -2018 [5] Drashti Talati; Dr. Miral Patel; Prof. Bhargesh Patel, Stock Market Prediction Using LSTM Technique, IJRASET – 2022. [6] K. Hiba Sadia; Aditya Sharma; Adarrsh Paul; Sarmistha Padhi; Saurav Sanyal, Stock Market Prediction Using Machine Learning Algorithms, IJEAT - 2019. [7] M. Roondiwala; H. Patel; S. Varma, Predicting stock prices using LSTM, International Journal of Science and Research (IJSR), vol. 6, no. 4, pp. 1754-1756, 2017. [8] Sampada A. Kulkarni; Shubham Gurav; Aditya Lahade; Deepak Gudavalekar; Nagnath Sangale, Stock Price Prediction Using LSTM, Indian Journal of Computer Science and Technology – 2024. [9] Achyut Ghosh; Soumik Bose; Giridhar Maji; Narayan C. Debnath; Soumya Sen, Stock Price Prediction Using LSTM on Indian Share Market, EPiC Series in Computing Volume 63 - 2019. [10] Adil Moghar; Mhamed Hamiche, Stock Market Prediction Using LSTM Recurrent Neural Network, IWSMAI 2020. [11] Shaikh Shoieb Abubaker; Syed Rouf Farid, Stock Market Prediction Using LSTM, IJRASET – 2022. [12] Kejia Zhang, LSTM Neural Network in Stock Price Prediction, Atlantis Press – 2023. [13] G. Peter Zhang, Time Series forecasting using a hybrid ARIMA and neural network model. Neurocomputing, 50, pp. 159-175 – 2003. [14] Selvin S; Vinayakumar R; Gopalakrishnan E A; Menon V K; Soman K P, Stock price prediction using LSTM, RNN and CNN-sliding window model. In 2017 international conference on advances in computing, communications, and informatics (icacci) (pp. 1643-1647). IEEE [15] Armin Lawi; Hendra Mesra; Supri Amir, Implementation of Long Short Term Memory and gated Recurrent Units on grouped time-series data to predict stock prices accurately, Journal of Big Data 9, Article Number: 89 – 2022. [16] Li H(2024), Optimizing Stock Price Prediction: Exploring LSTM Architectural Parameters in Financial Forecasting. Highlights in Science, Engineering and Technology, 85, 1095-1100. [17] Hochreiter S; Schmidhuber J, Long Short-Term Memory, 1997, Neural Computation, 9 (8), 1735 - 1780. [18] You, Y. (2024). Forecasting Stock Price: A Deep Learning Approach with LSTM And Hyperparameter Optimization. Highlights in Science, Engineering and Technology, 85, 328-338. [19] Deshpande V (2023). Implementation of Long Short-Term Memory (LSTM) Networks for Stock Price Prediction. Research Journal of Computer Systems and Engineering, 4(2), 60–72. [20] Khofifahturizqi A; Farikhin R H; Sihombing Y U, Prediction of Stock Price Volatility Using the Long Short Term Memory (LSTM) Model for Investment Portfolio Selection Strategy, Vol 7 No 5 (2024): Volume 07 Issue 05 May 2024 [21] Li, J. (2022). A Comparative Study of LSTM Variants in Prediction for Tesla’s Stock Price. BCP Business & Management, 34, 30-38. [22] Supriya Raut; Avinash Shrivas, Analysis & Stock Price Prediction and Forecasting Using Different LSTM Models, International Journal of scientific Research in Engineering and Management , Volume: 08 Issue: 04 | April – 2024. [23] Chen X (2023), Stock Price Prediction Using Machine Learning Strategies, BCP Business & Management, 36, 488-497. [24] Zenan Lu, Comparison of stock price prediction models for linear models, random forest and LSTM. ACE (2024) Vol. 54: 226-233. [25] Tan, J, (2024), Nvidia stock price prediction by machine learning. Highlights in Business, Economics and Management, 24, 1072-1076. [26] Diqi M; Ordiyasa I W; & Hamzah, H, (2024), Enhancing stock price prediction using stacked long short-term memory. IT Journal Research and Development, 8(2), 164-174. [27] Qian H, (2023), Review of stock price predicting method based on LSTM. Advances in Economics, Management and Political Sciences, 3(1), 479-488. [28] Li Z; Yu H; Xu J; Liu J; & Mo Y, (2023), Stock market analysis and prediction using LSTM: a case study on technology stocks. Innovations in Applied Engineering and Technology, 1-6. [29] Ding Y, (2023), Enhancing stock price prediction method based on CNN-LSTM hybrid model. Highlights in Business, Economics and Management, 21, 774-781. [30] Huang . F, (2023), Stock price prediction based on trend characterization. Proceedings of the 2nd International Conference on Mathematical Statistics and Economic Analysis, MSEA 2023, May 26–28, 2023, N.
Copyright © 2024 Meghana R, Shailaja K. P.. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Paper Id : IJRASET63696
Publish Date : 2024-07-20
ISSN : 2321-9653
Publisher Name : IJRASET
DOI Link : Click Here