Stock Forecasting Using Prophet vs. LSTM Model Applying Time-Series Prediction
Stock Forecasting Using Prophet vs. LSTM Model Applying Time-Series Prediction
Time series analysis aims to study path observations of 2.3 Analysis Based on Models
time series and build a model to describe the data structure There are many different machine learning algorithms
and predict future time series values. Due to the importance and approaches and finding the right method has proven
of time series prediction in many applied science branches, challenging [2]. Time series models and machine learning
it is necessary to build a useful model to improve prediction models are independent of technical and fundamental
[5]. The prevailing traditional methods of dealing with the analysis. They rely on mathematical theories and devise
problem consist mainly of fundamental analysis and useful models by entering training data. The derived model
technical analysis. Simultaneously, there are more can then be used to predict new data [4].
experiments to introduce new advanced techniques such as
machine learning for forecasting in recent years [4]. This paper proposed using a machine-learning model
Multiple data visualization is shown for different pattern for predicting the price of a given stock.
creation discussed in [15] and Student performance This project's challenge accurately predicts the future
prediction model is introduced in [16] applying data mining closing value of a given stock across a given period in the
regression model approach and getting the outcomes via future. This project was being used a prophet model and
some study factors from the dataset. Another simulation Long Short-Term Memory network, usually called
prediction outcomes is discussed in [17] by COVID-19 data "LSTMs," to predict Google's price in this paper and using
effects in Saudi Arabia. a data set of past prices.
for a timestamp and YYYY-MM-DD for a date. The y Apply the forecasting on the dataset using
column must be numeric, and it should represent the make_future_dataframe (). To store the data frame forecast
measurement or attribute which needs to forecast. and make prediction predict () function had been call.
Calling forecast () to see the predictions and inspect the data
Then create the data frame by use data.frame() frame and print the prediction's value. Forecasting the
function. then Fit prophet class prophet () into a new prophet model showed the prediction which predicted that
instance named "m." Prophet follows the sklearn model API. stocks would go up as shown in Fig. 7
The instance of the Prophet class is created and then call its
fit and predict methods. [11] The functions in the list below
were use in the model, which are part of the prophet library:
● cross_validation () to apply a cross-validation test for
testing the accuracy of the prophet model before use.
● performance_metrics () to compute the performance
MAPE metric on the output of our cross-validation.
● prophet () to apply for the prophet forecast.
prophet_plot_components () to plot components of
a prophet forecast, which will print with the trend,
weekly, yearly.
References
[1]. Ashutosh Sharma, Sanket Modak, Eashwaran Sridhar. Data
Visualization and Stock Market and Prediction. International
Fig. 11 forecast LSTM Research Journal of Engineering and Technology (IRJET). Volume:
06 Issue: 09, 2019
[2]. Frank Saldivar, Mauricio Ortiz. Stock Market Price Prediction Using
The data related to the Google stock market show that the
Various Machine Learning Approaches. 2019
average Rooted Mean Squared Error (RMSE) using LSTM [3]. Stock market prediction.
models are 78.831. Fig.12. https://en.wikipedia.org/wiki/Stock_market_prediction.
[4]. Xin-Yao Qian. Financial Series Prediction: Comparison Between
Precision of Time Series Models and Machine Learning Methods.
2017
[5]. SIMA SIAMI NAMIN, AKBAR SIAMI NAMIN. FORECASTING
ECONOMIC AND FINANCIAL TIME SERIES: ARIMA VS.
Fig.12. LSTM Accuracy Result. LSTM. 2018
[6]. PETER FOY. Machine Learning for Finance: Price Prediction with
5. Results and Discussion Linear Regression. 2019. https://www.mlq.ai/price-prediction-with-
linear-regression/
[7]. CHAU Tsun Man, SUEN Heung Ping, TO Cheuk Lam, WONG
Recalling the ideas of technical analysis in stock price Cheuk Kin. Stock Price Prediction App using Machine Learning
for pattern prediction [15] shows that with the use of Models Optimized by Evolution. 2019.
LSTMs, it can nearly correctly predict a future stock price. [8]. Jason Brownlee. Time Series Forecasting with Prophet in Python.
2020 https://machinelearningmastery.com/time-series-forecasting-
Consider these results to be very favourable and can serve
with-prophet-in-python/
as a baseline for future work. The RMSE calculating [9]. Kan Nishida. An Introduction to Time Series Forecasting with
showed that the accuracy of forecasting the two models Prophet in Exploratory. 2017. https://blog.exploratory.io/an-
must value. The LSTM model showed better accuracy than introduction-to-time-series-forecasting-with-prophet-package-in-
exploratory-129ed0c12112
the prophet. The prediction of Google stocks on LSTM [10]. SIMA SIAMI NAMIN, AKBAR SIAMI NAMIN.FORECASTING
showed continuity in value, where this prediction to the next ECONOMIC AND FINANCIAL TIME SERIES: ARIMA VS.
year 2021/22, there will be a significant increase in the LSTM. 2018
value of stocks. [11]. Ashish Vishwakarma, Alok Singh, Avantika Mahadik, and Rashmita
Pradhan. Stock Price Prediction Using Sarima and Prophet Machine
Prophet algorithm was not as robust as an LSTM
Learning Model. International Journal of Advanced Research in
implementation. Considering that our only data input was Science, Communication, and Technology (IJARSCT). Volume 9,
previous stock prices as training data, to predict the next Issue 1, September 2020
year of future stock price movement, which high accuracy [12]. Shakir Khan and Hela Alghulaiakh, "ARIMA Model for
Accurate Time Series Stocks Forecasting." International Journal of
shows the prowess of LSTMs and recurrent neural networks.
Advanced Computer Science and Applications (IJACSA), 11(7),
2020. http://dx.doi.org/10.14569/IJACSA.2020.0110765
6. Conclusion [13]. Shakir Khan and Amani Alfaifi, "Modelling of Coronavirus
Behaviour to Predict it is Spread" International Journal of Advanced
Computer Science and Applications (IJACSA), 11(5),
The research used Google stocks historical data for the past 2020. http://dx.doi.org/10.14569/IJACSA.2020.0110552
five from October 7, 2015, to October 7, 2020, to compare [14]. Abu Sarwar Zamani, Nasser Saad Al-Arifi and Shakir Khan,.
the prophet model and LSTM models' results. After several Response Prediction of Earthquake motion using Artificial Neural
tests, LSTM showed accurate results in its calculating Networks. International Journal of Applied Research in Computer
Science and Information Technology. 2012. Vol. 1, No. 2, pp. 50-
values, which showed the potential of using the LSTM 57.
model on time series data to accurately predict stock data,
which will help investors in stocks in their investment
192 IJCSNS International Journal of Computer Science and Network Security, VOL.22 No.2, February 2022