Stock Price Prediction using Prophet Facebook Algorithm for BBCA and TLKM

ABSTRACT


INTRODUCTION
Stocks are one of the investment instruments that are booming in the community, including in Indonesia. Stock prices are very volatile, so investors must have certain skills to predict stock prices. Stock prices that are not easily predictable cause investors to hesitate to invest. Thus, we need a method that makes it easy to predict stock prices [1], such as Support Vector Machine [2], LSTM with BPNN [3], GRU and ICA [4], SV-KNNC [5], K-MEANS [6], ARIMA [7], and many more.
This study proposed a method, namely the Prophet Facebook algorithm. Prophet Facebook is the right method for predicting stock prices, because the modeling is more practical and the analysis of supporting data is deeper for future predictions. [8]. Prophet is an open-source library (free) which is based on a decomposable model. Prophet is a model for forecasting time series based on the additive model developed by the Facebook Data Science team. This model has the ability to make time series predictions with good accuracy using simple parameters. One of the advantages of Prophet is that it has support for including seasonality and irregular components. Researcher [9].
The Open, High, Low, and Close with a time series data model [10] from May 3rd, 2021 to April 28th, 2022. While the testing data used is the data from May 1st, 2022 until the time of testing, which is May 7th, 2022. The measurement used is MSE [11], RMSE, and MAE. The Root Mean Square Error (RMSE) has been used as a standard statistical metric to measure model performance in meteorology, air quality, and climate research studies. The mean absolute error (MAE) is another useful measure widely used in model evaluations.

METHOD 2.1. Related Work
Mehar Vijh, et al in their research explained that Artificial Neural Network and Random Forest techniques have been utilized for predicting the next day closing price for five companies belonging to different sectors of operation. The financial data: Open, High, Low and Close prices of stock are used for creating new variables which are used as inputs to the model. The models are evaluated using standard strategic indicators: RMSE and MAPE. The low values of these two indicators show that the models are efficient in predicting stock closing price [12]. Stock market predictions during the Covid-19 Pandemic in India were researched by Anusha Garlapati, et al. In this case, Facebook Prophet and Arima models are used in forecasting the retail valuation of future stocks that are used to analyze future values of stock markets and how it varied from previous stock markets. With the circumstantial architecture and consideration of conjecture premises and data preprocessing techniques, this effort commits to retail estimate analysis [13].
The Facebook Prophet method is used to predict time series data on supermarket sales by Bineet Kumar Jha and Shilpa Pande. This study compared the performance of Facebook Prophet with Autoregressive Integrated Moving Average (ARIMA). From the propsoed research work, it is concluded that, FB Prophet is a better prediction model in terms of low error, better prediction, and better fitting [14]. Abdulhamit Subasi, et al predicted stock market by inputting different classifiers, such as Random Forest, Bagging, AdaBoost, Decision tree, SVM, K-NN, and ANN. The National Association of Securities Dealers Automated Quotations System (NASDAQ), New York Stock Exchange (NYSE), Nikkei, and Financial Time Stock Exchange (FTSE). Furthermore, several machine learning algorithm are compared with a normal and leaked data set [15]. Time series data is used to forecast sales using machine learning methods. The results show that using stacking techniques, they can improve the performance of predictive models for sales time series forecasting [16].
Energy consumption data in the form of time series were analyzed using machine learning method by Jui-Sheng Cou and Dhin-Nhat Troung. The analytical results confirm that the proposed system, JS-LSSVR (SARIMA, LSSVR), can predict multi-step ahead time series energy consumption with higher accuracy than the linear model (ie, SARIMA), nonlinear model (ie, LSSVR), hybrid model (ie, JSLSSVR), hybrid systems (ie, TLBO-LSSVR (SARIMA, LSSVR) and TLBOLSSVR (SARIMA, LSSVR)), and prior studies. Numerical experiments show that the JS-LSSVR (SARIMA, LSSVR) system can forecast energy consumption 1 week ahead efficiently (from 9.8 to 21.4 seconds on average) [17]. Ronnachai Chuentawat and Yosporn Kan-ngan compare multivariate and univariate time series data using Support Vector Machine and Genetic Algorithm with RMSE and MAPE parameters. The result shows univariate time series models have lower error than multivariate time series models for all of 3 data subsets [18]. Analysis and forecasting of time series data was carried out by Christophorus Beneditto Aditya Satrio, et al using the ARIMA algorithm and Prophet Facebook for data on the spread of COVID-19 in Indonesia. The result shows that Prophet generally outperforms ARIMA, despite it being further from the actual data the more days it forecasts [19].

Research Method
To conduct this research, the researcher took several steps, the first was looking for the data from the top 50 Biggest Market Capitalizations to be used as a reference in viewing stocks based on the top data. After the data is obtained, then the forecasting analysis preprocessing process uses the Prophet Facebook algorithm. The following is the flow of the method carried out as shown in Figure  1.

Data of The Biggest Market Capitalization
The following are the top 50 Biggest Market Capitalization data, the source of this data is taken from www.idx.co.id for the period of March 2022 as shown in table 1 below

The Data of Stock Price BBCA and TLKM
The following is BBCA and TLKM stock price data taken from www.finance.yahoo.com with a range for one year, these are April 2021 to May 2022. The data includes Date, Open High, Low and Close as shown in the table 2 and 3 below.  From this data, after doing the preprocessing stage, the data is ready for training using the Prophet Facebook algorithm.

Model Using Prophet Facebook
Basically, the Facebook Prophet Algorithm is to generate a time series model that uses some old ideas with some new changes, it's very good at modeling time series that has multiple seasons and doesn't face some of the weaknesses of the other algorithms. In essence it is the sum of the three functions of time plus an error term like the following formula.
The following is a description of the formula above. These are growth g(t), seasonality s(t), holidays h(t), and error ∈_t. Thus, in the case of stock prices, it can be included using The Growth Function (and change points) because imper-icily the data can change from time to time. To perform the number of growths there are 3 options including Linear Growth, Logistic Growth, and Flat. In the case of BBCA and TLKM stock prices, we use the Linear Growth method with the default Prophet Facebook because there is a slight slope of each time series, whether it's High or Low, here is the formula for Linear Growth.
With slope m and offset b is variable and will change in value at each point of change.

RESULTS AND DISCUSSION
The experiment that will be carried out is to use the BBCA and TLKM stock prices in tables 2 and 3.

Training dan Testing of BBCA Stock Price
In this process, testing data that has been validated using the Prophet Facebook algorithm with a time range of 30 days in April 2022, the following results are as shown in Figure 2

Training dan Testing of TLKM Stock Price
In the TLKM data, the treatment is the same as the BBCA data as shown in Figure 5 below.

Trand Prediction
There are several prediction trends for per year and per week as shown in Figures 8 and 9 below for BBCA and TLKM. The next is the trend for the stock price of TLKM per week as shown in Figure 9 below. Figure 9. Trend per-week Stock Price TLKM

CONCLUSION
Based on the results of the experiment that the Prophet Facebook algorithm can model time series quickly, even in conducting training data. The algorithm can quickly process training data well in terms of predicting. For the results of training this algorithm can predict in a short time. Long, in this study we forecast within one year with each stock, namely BBCA and TLKM, from the training results the trend of these two stocks will continue to increase until 2023 in April. This method match to predict time series data, suggestion for the future research is the method can apply in multivariate time series data.