Stock Price Prediction Using Time Series
Stock Price Prediction Using Time Series
https://doi.org/10.22214/ijraset.2021.39296
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue XII Dec 2021- Available at www.ijraset.com
Abstract: Predicting Stock price of a company has been a challenge for analysts due to the fluctuations and its changing nature
with respect to time. This paper attempts to predict the stock prices using Time series technique that proposes to observe various
changes in a given variable with respect to time and is appropriate for making predictions in financial sector [1] as the stock
prices are time variant.
Keywords: Stock prices, Analysis, Fluctuations, Prediction, Time series, Time variant
I. INTRODUCTION
Any Investor, individual or firm expects a good or reasonable number of returns on their investments. Investing in Stocks is one of
the better options to get a good ROI (Return on investment). This requires investors to have a good understanding of various stocks
and their current prices. To maximize the profits and minimize the losses requires a good prediction of the price when to buy a stock
and when to sell the same. Some of the Forecasting principles are discussed in Efficient Market Hypothesis and Eliot Wave Theory
[6]. In general, the stock prices are mainly determined by the actions of the institutional investors, we call them big buyers and big
sellers. The Price Auction will be high for that day if the buyers are more and less when sellers are more. Finally, the price will be at
the point of control that is mean price or most of the price at which most of the time of the price holds. Most of the time the price is
normally distributed. So based on the price of the auction the entry point and exit point should be identified to get maximum profit
and the stop loss point to be predicted properly to have efficient risk analysis. For achieving the same popular statistical techniques
like Auto Regression and Moving Averages are being used extensively.
Modern computing technics like machine learning facilitates prediction with more accuracy with Hybrid models like Auto-
Regressive Integrative Moving, Exponential Smoothing, ARIMA (Auto Regressive Integrated Moving Average') [7], Naïve
Forecasting, Seasonal Naïve Forecasting or Neural Networks. Our current proposed model will use all the modern techniques and
predict the stock price at a given point and ranks each of the models to facilitate the user to make a decision when to buy or sell a
particular stock, doing a short-term trade or long term to maximize their profits. This model uses all the modern techniques and is
different from the traditional approaches having a high probability of accurate prediction.
II. METHEDOLOGY
The proposed steps for achieving the objective are as follows, Initially, the data needs to be fed to the system that is extracted from
Yahoo! Finance on monthly basis and the data imported is cleaned by making sure that outliers are removed and a filter is applied to
reject the null values in the data. Then data is converted into time series objects and the ADF test is applied to make sure the data is
stationary. Then the time series object is decomposed as the results depend on many factors to achieve accurate results the time
series object must be decomposed to observe various seasonality factors and trends. Then the time series objects are fed to various
algorithms like ARIMA, Exponential Smoothing, Naïve Forecasting, Seasonal Naïve Forecasting, Neural Networks etc. figure 2.1
demonstrates the workflow.
B. Exponential Smoothing
This forecast technique in which the past data is assigned with some weights in such a way that, they are exponentially decaying
with respect to time. The latest weights are at the top and as time factor is increased, they start decaying.
C. Naïve Forecasting
The forecast is set to previous data without applying any predictions and is achieved through following equation.
y′ (T + h) |T= y (T). (1)
Where, (T + h) refers to the forecast related to past data
(T), refers to the forecast related to current data
E. Neural Networks
This type of forecasting is used in nonlinear and complex forecasting scenarios and denoted as NNAR (p, x) where p is number of
lagged inputs and x is number of hidden layers. The architecture of Neural Networks is shown in the figure 3.1 [5].
Fig 4.1.2 Plotting data received from yahoo finance (Apple stock index)
3) Decomposition of Plots: Decomposition of plots is required to know about various trends in the current market [5]. Is shown in
fig 4.1.3
4) Analysing the seasonality of Apple Stock Index: To observe the various patterns of apple stock prices in the previous years and
the current year as shown in figure 4.1.4
5) Applying Augmented Dickey Fuller Test (ADF): ADF test is applied to check whether the time series is stationary, the results of
ADF can be viewed in figure 4.1.5 The ACF and PACF plots are used to compare current data with past data including their
residuals [4].
6) Splitting Data into Train and Test Datasets: Generally, before building a model we need to spit the data into train and test sets,
with the help of training set, model needs to be built and with the help of test set the model needs to be tested for its
performance.
2) Exponential Smoothing
Forecast Values predicted by ETS can be observed in the figure 4.2.2.1
3) Naïve Forecasting
Forecast values predicted by Naïve model can be observed in the figure 4.2.3.1
Fig. 4.2.4.3 Visualizing stock prices predicted using seasonal naïve forecasting
5) Neural Networks
Forecast values predicted by Neural Networks can be observed in the figure 4.2.5.1
V. CONCLUSION
Stock price has been predicted, in this case Exponential smoothing outperformed other models but depending on situation and data
the performance might vary, when we receive data, it’s recommended to feed the data to all the models, compare the results and
consider the accurate result depending upon the ranks.
REFERENCES
[1] T. Huamin, D. Qiuqun and X. Shanzhu, "Reconstruction of time series with missing value using 2D representation-based denoising autoencoder," in Journal of
Systems Engineering and Electronics, vol. 31, no. 6, pp. 1087-1096, Dec. 2020, doi: 10.23919/JSEE.2020.000081.
[2] A. A. Ariyo, A. O. Adewumi and C. K. Ayo, "Stock Price Prediction Using the ARIMA Model," 2014 UKSim-AMSS 16th International Conference on
Computer Modelling and Simulation, 2014, pp. 106-112, doi: 10.1109/UKSim.2014.67.
[3] A. Gupta and A. Kumar, "Mid Term Daily Load Forecasting using ARIMA, Wavelet-ARIMA and Machine Learning," 2020 IEEE International Conference on
Environment and Electrical Engineering and 2020 IEEE Industrial and Commercial Power Systems Europe (EEEIC / I&CPS Europe), 2020, pp. 1-5, doi:
10.1109/EEEIC/ICPSEurope49358.2020.9160563.
[4] International Journal of Innovative Technology and Exploring Engineering (IJITEE) ISSN: 2278-3075, Volume-9 Issue-5, March 2020. Retrieval Number:
D1869029420/2020©BEIESP DOI: 10.35940/ijitee.D1869.039520
[5] International Journal of Innovative Technology and Exploring Engineering (IJITEE) ISSN: 2278-3075, Volume-8, Issue-9S4, July 2019 Retrieval Number:
I11400789S419/19©BEIESP DOI:10.35940/ijitee.I1140.0789S419
[6] E. F. Fama, "Efficient Capital Markets: II," The Journal of Finance, vol. 46, pp. 1575-1617, 1991.G.S. Atsalakis, E.M Dimitrakakis. and C.D. Zopounidis,
“Elliot Wave Theory and neuro-fuzzy systems, stock market prediction: The WASP system”, Expert Systems with Applications, vol. 38, pp.9196–9206, 2011.
[7] S. K.Mitra, “Optimal Combination of Trading Rules Using Neural Networks”, International Business Reearch, vol. 2, no. 1, pp. 86-99, 2009
[8] https://www.google.com/finance/