0% found this document useful (0 votes)
156 views

Stock Prediction Analysis Using LSTM

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views

Stock Prediction Analysis Using LSTM

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

STOCK PREDICTION ANALYSIS USING LSTM

Authors
Sushruta Mishra
Oindrila Ajha
Tiyasha Dutta
Souryadipta Das
Soham Das

Presented by Co-author
Oindrila Ajha
1. INDEX:

● INTRODUCTION
● LITERATURE REVIEW
● HIGHLIGHTS OF THE PAPER
● PROPOSED METHODOLOGY
● RESULTS AND DISCUSSION
● COMPARATIVE ANALYSIS WITH OTHER MODELS
● CONCLUSION AND FUTURE SCOPE
● REFERENCES
2. ABSTRACT:

Stock analysis is a way for traders and financial experts to study the stock market and make smart decisions
about buying and selling shares. It involves doing thorough research to understand how well a stock or an
industry is performing before making any investments. There are two main types of stock analysis: technical
and fundamental. Technical analysis uses past market data and charts to predict how stocks might behave in
the future. On the other hand, fundamental analysis looks at a company's data, like its financial history and
how it makes money, to figure out if it's a good investment. The main goal of stock analysis is to pick the best
times to buy and sell stocks. Traders might focus on one type of analysis or use both. No matter the method,
doing careful research is really important to make wise investments and avoid losing money.

Keywords - Stock Analysis, Technical analysis, Shares, Predict future advances, fundamental analysis, revenue
streams, traders, investments
3. INTRODUCTION:
In essence, prominent quantitative traders with substantial capital engage in the practice of purchasing stocks, futures, and
equities at discounted rates and subsequently selling them at premium prices. While discussions about trends in stock market
forecasting are not novel, investors commonly undertake two distinct types of stock analysis before making purchase
decisions. The first is fundamental analysis, where investors evaluate a stock's intrinsic value in conjunction with factors such
as market conditions, the economy, and the political landscape. Conversely, technical analysis delves into market data,
examining past prices and volumes to trace the evolution of equities. The increasing significance of machine learning in various
industries has motivated traders to apply these methodologies to the stock market, yielding positive results in some instances.
This essay outlines the creation of a program for predicting financial data, utilizing a dataset comprising historical stock price
data for algorithm training. The primary goal of these predictions is to mitigate uncertainty associated with investment strategy
selection.

The stock market, often characterized by a random walk, presents challenges in forecasting due to volatility. Investor
confidence is notably impacted by the volatility of stock market indices, attributed to the dynamic and unpredictable nature of
stock values influenced by various factors. Machine learning has been employed in endeavors to predict stock values, with
research projects having distinct goals, such as short-term, long-term, or quick predictions, focusing on specific stocks,
industries, or general trends. Two prediction types, dummy predictions based on established rules and real-time predictions
utilizing internet-derived stock prices, are employed in stock market prediction systems. Notably, machine learning methods,
particularly the LSTM algorithm in Python, have been introduced for forecasting the stock market, leveraging advancements in
4. LITERATURE REVIEW :
REFERENCE MODEL KEY FEATURES TRAINING DATA ACCURACY

[1] HYBRID Model Sentiment analysis and Historical stock price >90%
technical indicators data

[2] SVR and MACD Model Support vector Historical stock price >80%
regression and moving data
average convergence
divergence

[3] LSTM and RF Model Long short-term Financial data and >80%
memory and random textual data from news
forest articles

[4] LSTM and BOW Model Long short-term Financial news articles >80%
memory and bag-of- and stock price data
words

[5] LSTM and Sentiment Long short-term Financial news articles >88%
Analysis Model memory and sentiment
analysis
4. LITERATURE REVIEW :
REFERENCE MODEL KEY FEATURES TRAINING DATA ACCURACY

[6] ARIMA and Big Data Autoregressive integrated Stock price data, news articles, >80%
Analytics Model moving average and big data social media data, economic
analytics indicators

[7] Linear Regression and Linear regression and long Financial news and technical Improvement
LSTM Model short-term memory indicators in accuracy

[8] Sentiment Analysis of Sentiment analysis of tweets Social media data, technical Improvement
Tweets Model and technical indicators indicators in accuracy

[9] Ensemble Combination of decision tree, Not specified Gradient


Models(Decision Tree, artificial neural network, support boosting
ANN, SVM, k-NN, RF, vector machine, k-nearest achieved
Gradient Boosting) neighbor, random forest, and highest
gradient boosting accuracy

[10] Technical Indicators Moving averages, relative Stock data from the Indian stock Outperformed
and Sentiment Analysis strength index, stochastic market established
Model oscillator, and sentiment approaches
analysis
5. HIGHLIGHTS OF THE PAPER:
Some main highlights of our stock prediction model that uses moving average deep learning technique (LSTM) and Python
Streamlit are:
1. Advanced Predictive Analysis: Our stock prediction model is equipped with deep learning capabilities, specifically utilizing
LSTM algorithms, to analyze vast amounts of historical stock data. This in-depth analysis helps identify patterns that can
aid in making predictions about future stock prices.
2. Diverse Data Sources: The model offers the flexibility to work with multiple datasets from the yfinance library. This allows
traders to examine stock prices from various companies and sectors, enabling them to make well-informed comparisons
and decisions.
3. User-Friendly Streamlit Dashboard: We've created an interactive Streamlit dashboard that simplifies the process of
visualizing predicted stock prices alongside actual data. This feature empowers users to easily track trends over time,
making it a valuable tool for traders.
4. Easy Customization: Built with Python, our model is incredibly user-friendly and highly customizable. This means you can
easily tweak it to fit your specific needs, integrate it with other data sources, and even enhance its functionality with
additional analytical tools.
5. LSTM Precision: Our model stands out for its accuracy in predicting stock prices, thanks to the power of LSTM deep
learning techniques combined with moving averages. Traders can rely on these accurate predictions to make well-
informed investment decisions across a diverse range of industries and companies.
Overall, this model can offer traders a powerful and flexible tool for analyzing and predicting stock prices across a wide range of
industries and companies.
6. PROPOSED METHODOLOGY : 1. Raw Stock Data: Unprocessed and uninterested information on stocks and
the stock market is referred to as "raw stock data." Data that is recorded and
reported by financial institutions, media outlets, and data providers includes
stock prices, trade volumes, business financial reports, and other measures.
2.Data Cleaning and Preprocessing: The actions taken to prepare raw data
for analysis are referred to as data cleaning and preprocessing. This
procedure entails cleaning up any errors, discrepancies, or missing numbers
from the data and converting it into a format that can be used for analysis.
3.Expansion of Available features: Data cleaning and preprocessing are the
procedures used to get raw data ready for analysis. This process comprises
fixing any mistakes, conflicts, or missing data from the data and transforming
it into an analysis-ready format.
4.Refining relevant features: Refining relevant features is an important
process used in data analysis to improve the accuracy and efficiency of the
model by highlighting the essential elements in the dataset.
5.Dimension Reduction using Principal Component Analysis (PCA):
Dimension reduction is an important tool in data analysis. It involves
minimizing the number of features in a dataset while retaining the important
data and PCA or Principal Component Analysis is a most popular method for
data reduction.
6. PROPOSED METHODOLOGY : 6.High Weighted Features Extraction: High weighted feature extraction is a
technique used in data analytics to identify and rank the most important
features in a dataset. Weights are related to features which are extracted
from the dataset depending upon their importance of the analysis. And the
features having the maximum weights are used for further investigation.
7.Model Building using Convolution Neural Networks, Long Short-Term
Memory (LSTM), or a combination of both: For the analysis of complex data,
such as photos, videos, or time series data, model creation utilizing
convolutional neural networks (CNNs), long short-term memory (LSTM), or a
mix of the two is a potent method.
8.Hyper parameter tuning to obtain better results: In order to enhance the
performance of a machine learning model, hyper parameter tuning involves
optimizing the values of the hyper parameters. Hyper parameters are settings
made before the model is trained and cannot be discovered through data
learning. The model's learning rate, regularization intensity, number of
hidden units, number of layers, and other parameters are controlled by them.
9.Training the model with respect to time on stock datasets: Using past stock
price data, one can forecast future stock prices by training a model on stock
datasets. The length of time the model is trained over is a crucial factor to
take into account when training a model on stock datasets.
6. PROPOSED METHODOLOGY :

10.Evaluating the stock data model: A stock data model's predictive accuracy
must be measured in order to evaluate it. In this context, a number of
frequently used evaluation measures are employed, including Mean squared
error (MSE), Mean absolute error (MAE), R-squared (R2), Sharpe ratio, and
Profit and loss (P&L).
11.Testing the stock data model: A stock data model is tested by comparing
its performance to results from a fresh, unrelated dataset that was not used
in the model's development. To make sure that the model's performance is
not biased towards the training data and that it can generalize effectively to
new, untested data, it is crucial to do this.
12.Visualization of the stock data model: Visualizing the stock data model
means using graphs and charts to show and understand how well the model
predicts and performs. This visual approach helps us see patterns and trends
in the data and pinpoint where the model might need some tweaks for better
results.
7. RESULTS & DISCUSSION:

This graph is a depiction of change in stock prices


with time for the stock ticker as AAPL. The above
graph shows the growth in stock prices over the
years ranging from 2010 to 2020.

This graph shows the real-time comparison


between the predicted price as predicted by our
model and the original price of stocks of the stock
ticker as AAPL.
7. RESULTS & DISCUSSION:

A series of averages of various subsets of the entire data set


are created using the statistical calculation known as the
moving average (MA), which is used to analyze data points.
The most frequent use of moving averages in the realms of
finance and investment is in the technical evaluation of
stock prices. The formula for calculating a moving average is
to add up all of the prices or other data points during a
given period, then divide that total by the total number of
data points during that period. For example, a 10-day
moving average of a stock price would be calculated by
adding up the last 10 days' closing prices and dividing by 10.
The alongside graphs shows the comparison of stock prices
with time in accordance with 100 moving average and 100
and 200 moving averages respectively.
8. COMPARATIVE ANALYSIS WITH OTHER MODELS:
ALGORITHM PROS CONS

LSTM ➔ Can handle long-term ➔ Can be computationally expensive


dependencies and can handle data ➔ Can suffer from overfitting
of variable sequence length. ➔ Requires a lot of data to train
➔ Can model non-linear relationships properly
between input features and target
variable
➔ Can be used for both univariate
and multivariate time series
forecasting

ARIMA ➔ Can handle auto correlated data ➔ Assumes linear relationships


➔ Can provide statistical measures of between input features and target
confidence in the forecasts variable
➔ Can be used for both univariate ➔ Requires the data to be stationary,
and multivariate time series which may not always be the case
forecasting for stock prices
➔ Cannot handle variable-length
sequences of data
8. COMPARATIVE ANALYSIS WITH OTHER MODELS:

ALGORITHM PROS CONS

PROPHET ➔ Can model seasonality, trend, and ➔ Cannot handle non-linear


holiday effects in the data relationships
➔ Can handle missing data ➔ Cannot handle variable-length
➔ Provides a Bayesian framework for sequences of data
modeling uncertainty in the ➔ Can be computationally expensive
forecasts

RANDOM FORREST ➔ Can handle non-linear ➔ Cannot handle variable-length


relationships between input sequences of data
features and target variable ➔ Cannot model auto correlated data
➔ Can handle missing data as well ➔ Cannot model seasonality, trend,
as both categorical and numerical or holiday effects in the data
input features.
➔ Can provide a measure of feature
importance in the prediction
8. COMPARATIVE ANALYSIS WITH OTHER MODELS:

ALGORITHM PROS CONS

GRADIENT BOOST ➔ Can handle non-linear ➔ Cannot handle variable-length


relationships between input sequences of data
features and target variable ➔ Cannot model auto correlated data
➔ Can handle missing data ➔ Cannot model seasonality, trend,
➔ Can handle both categorical and or holiday effects in the data
numerical input features ➔ Can be computationally expensive
➔ Can provide a measure of feature and slow to train
importance in the prediction
9. CONCLUSION & FUTURE WORK :
To make future purchasing and selling decisions, stock market analysis involves examining both recent and historical market
movements. The percentage rise represents the change in stock value from the previous day. The stock is more volatile the
higher the positive or negative value. A decision support system can be created to aid investors in determining which
industry stock to select for low-risk, low gain or high-risk, huge gain, depending on their level of risk tolerance.

Some of the few things to remember are firstly, predicting stock price or movement is a very challenging endeavor.

● Personally, it is believed that any of the stock prediction models available should be taken for granted or relied upon
without careful consideration. However, models might be able to accurately forecast changes in stock price.

● Secondly, avoid falling for publications that display forecast curves that perfectly overlap actual stock values. This is
meaningless in practice and can be duplicated with a straightforward averaging technique. Predicting the swings of the
stock price is a more sensible course of action.

● Lastly, the findings you get have a huge impact on the model's hyper-parameters. Running certain techniques on the
hyper-parameters would therefore be a really excellent idea.
10. REFERENCES :
1. "A hybrid machine learning model for stock price prediction using sentiment analysis and technical indicators," by V. Sharma et al. (2021). DOI:
10.1109/ICAS51307.2021.9415016.
2. "Stock price prediction using machine learning algorithms and technical analysis," by S. S. Gupta and S. Kumar (2021). DOI:
10.1109/ICPS48432.2021.9483429.
3. "Stock price prediction using machine learning algorithms with financial and textual data," by Y. Zhao et al. (2020). DOI:
10.1016/j.procs.2020.09.129.
4. "Machine learning-based stock price prediction using financial news articles," by S. Kwon and J. Lee (2020). DOI: 10.1016/j.dcan.2019.07.005.
5. "Stock price prediction using machine learning and sentiment analysis," by H. A. Alzahrani et al. (2020). DOI: 10.1007/978-3-030-49190-1_31.
6. "Stock price prediction using machine learning algorithms and big data analytics," by T. Gao et al. (2019). DOI: 10.1016/j.future.2019.06.027.
7. "A machine learning-based stock price prediction model using financial news and technical indicators," by J. Liu et al. (2019). DOI:
10.1109/ICMLA.2019.00139.
8. "A stock price prediction model using machine learning algorithms and social media analysis," by Z. Ma et al. (2019). DOI: 10.3390/app9224851.
9. "A comparative study of machine learning techniques for stock price prediction," by S. Selvin et al. (2018). DOI: 10.1109/ICRIS.2018.8598704.
10. "Stock price prediction using machine learning techniques and time series analysis," by G. Jain and S. Kumar (2017). DOI:
10.1109/ICCSP.2017.8286499.
THANK YOU!

You might also like