Stock Price Prediction: By: Aarushi Sunderrajan (S0 Paridhi Deval (S0 Pranjal Gupta (S059)
Stock Price Prediction: By: Aarushi Sunderrajan (S0 Paridhi Deval (S0 Pranjal Gupta (S059)
Stock Price Prediction: By: Aarushi Sunderrajan (S0 Paridhi Deval (S0 Pranjal Gupta (S059)
Prediction
By:
Aarushi Sunderrajan (S0
Paridhi Deval (S0
Pranjal Gupta (S059)
Overview
Contents Introduction
About the Subject
Methodology
Objectives
Types of patterns with time
What is ARIMA?
Time series forecasting with ARIMA
What is SARIMA?
Result
Conclusions
Short Comings
Future scope
Bibliography
Acknowledgement
Overview
YEAR EVENT
In 1981-82 Iranian Revolution
In 1990’s Oil price shock
In 2000 Dot-com bubble
In 2008 Sub-prime crisis
In 2020 COVID crisis
About the Subject
Key Points
• Trends - Price of assets follow a general direction over a long period of
Types of Patterns in time, irrespective of the short term behavior. There are only three
directions in which prices can go – upwards (uptrend), downwards
(downtrend) and sideways trend.
price with time
• Seasonality and cyclicality – Repeating price action over periods of
Types of Patterns in months is referred to as seasonality and that in years is referred to
as cyclicality.
ARIMA
portfolio that covers a wide range of cars, SUVs, buses, trucks, pickups
and defense vehicles.
• Now let’s start with the task of Time Series Forecasting with ARIMA.
We first collected the Tata Motors stock price data using the Yahoo
Finance API.
Time Series • Importing the required packages
Forecasting using
ARIMA
Time Series We only need the date and close prices columns for the rest
of the task, so let’s select both the columns and move
Forecasting using further:
ARIMA
Time Series Visualizing the close prices of TATA MOTORS before
moving forward
Forecasting using The plot:
ARIMA
Using ARIMA for • Before using the ARIMA model, we have to figure out
whether our data is stationary or seasonal. The data
Time Series visualization graph about the closing stock prices
above shows that our dataset is not stationary. To
check whether our dataset is stationary or seasonal
Forecasting properly, we can use the seasonal decomposition
method that splits the time series data into trend,
seasonal, and residuals for a better understanding of
the time series data:
Using ARIMA for
Time Series
Forecasting
Using ARIMA for • So our data is not stationary it is seasonal. We need to
use the Seasonal ARIMA (SARIMA) model for Time
Time Series Series Forecasting on this data. But before using the
SARIMA model, we will use the ARIMA model. It
will help you learn using both models.
Forecasting • To use ARIMA or SARIMA, we need to find the p, d,
and q values. We can find the value of p by plotting
the autocorrelation of the Close column and the value
of q by plotting the partial autocorrelation plot. The
value of d is either 0 or 1. If the data is stationary, we
should use 0, and if the data is seasonal, we should
use 1. As our data is seasonal, we should use 1 as the
d value.
What is SARIMA? • SARIMA stands for Seasonal-ARIMA and it includes
seasonality contribution to the forecast. The
importance of seasonality is quite evident and ARIMA
fails to encapsulate that information implicitly.
• The Autoregressive (AR), Integrated (I), and Moving
Average (MA) parts of the model remain as that of
ARIMA. The addition of Seasonality adds robustness
to the SARIMA model.
• Similar to ARIMA, the P,D,Q values for seasonal
parts of the model can be deduced from the ACF and
PACF plots of the data.
To find the value In the autocorrelation plot, the curve is moving
down after the 4th line of the first boundary. That
of p: is how we decide the p-value.
Hence the value of p is 4
To find the value In the partial autocorrelation plot, we can see that
only two points are far away from all the points.
of q: That is how to decide the q value.
Hence the value of q is 2.
Now let’s build an The predicted values are wrong because the data
is seasonal.
ARIMA model ARIMA model will never perform well on seaso
nal time series data
Building a
SARIMA model
Prediction: Now let’s predict the future stock prices
using the SARIMA model for the next 10
days:
Plotting the prediction:
The red line indicates the predicted value for price of the stock.
Result
•A
Conclusion
First and foremost, we would like to thank our Mentor Dr. Suresh
Pathare who guided us in doing this project. He provided us with
valuable advice and helped us. His motivation and help
contributed tremendously to the successful completion of the
project. Besides, we would like to thank all the teachers who
helped us by giving us advice and providing the equipment which
we needed.
THANK YOU