Emehss2022 231 242
Emehss2022 231 242
Volume 25 (2022)
1. Introduction
The recent volatility of the U.S. financial market can be attributed to negative macroeconomic
conditions. Issues of political uncertainty, higher recessionary expectations, and concerns over the
COVID-19 pandemic have negatively affected the U.S. Stock Market. This creates a need for an
accurate model that forecasts stock prices. Studies on forecasting stock prices have been done
extensively. The nonlinearity of the stock market, along with the noisy data, has made stock price
forecasting difficult. In past literature, the forecasting of stock prices was done by statistical models.
Statistical models such as ARIMA was useful at predicting stock prices (Ariyo et al., 2014). The stock
market is volatile in nature, so other methods were used to forecast. Machine learning have been
popular among researchers who seek to gain a better understanding of the stock market’s behavior.
For example, one study evaluated the predicting accuracy of different tree-based ensemble ML
methods (Ampomah et al., 2020). In this study, six ML models were used, including Random Forest,
XGBoost Classifier, Bagging Classifier, and more. The experiment was based on historical data from
2005 to 2019. The data was obtained from NYSE, NASDAQ, and NSE. The Extra tree model
demonstrated better precision than other models. Liu et al. proposed a hybrid framework combining
PSO, dpLSTM, ORLEM, and EWT to predict daily stock closing prices (Liu & Long, 2020). The
experiment extracted stock closing prices from the U.S. and China to make predictions. The hybrid
model improved the prediction accuracy when compared to traditional ML models. A study in 2020
used three different ML algorithms to predict stock behavior. These algorithms were Support Vector
Machine, Logistic Regression, and Perceptron (Parray et al., 2020). Time-series data were collected
from 2013 to 2018 from the Indian National Stock Exchange. Researchers then calculated technical
indicators to use as parameters. Only historical stock prices were used as inputs of the prediction in
this experiment. All three models had high accuracy in predicting stock behavior. The Support Vector
Machine reached 87.35% average accuracy when the time-series dataset was not organized into a
supervised learning format. These studies show that accurate forecasting of stock prices can be
achieved. However, most stock prediction papers have an overarching problem of using only
historical data. Our main contribution addresses this problem, and the next section discusses our
contribution in details.
231
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
The rest of the paper is structured as follows: Section 3 reviews works of literature on stock
prediction, addresses problems related to these works, and introduces a novel model to predict future
stock prices. Section 4 describes the methodology of the research. It details the features of the four
ML models and the five unique regressors used to influence the primary model. Section 5 presents
the experimental results and analyzes the predicting accuracy of the four models. Section 6 offers the
conclusion and proposal for future research.
2. Literature Review
A variety of ML models were used by researchers to predict future stock prices using past stock
prices. A study done in 2009 combined the Artificial Neural Network (ANN) and the Decision Tree
Model (DT) to predict stock performance (Tsai & Wang, 2009). The study discussed the widespread
use of ANN in forecasting and the additional DT model results in decision rules for future analysis.
Neural Network imitates the human brain with many layers of artificial neurons. A Decision Tree is
also known as a classification tree where tree nodes and branches indicate output and decision. The
hybrid model indicates whether the stock rises or falls. The results show that ANN + DT model
achieves 77% forecasting precision in electronic industry stock. This study employed both
fundamental and technical analysis. It used data related to the company’s performance as inputs.
However, no parameter related to the general economy was used. Nikou et al. applied time-series data
to assess the forecasting power of Deep Learning methods, Support Vector Regression method, and
Random Forest method (Nikou et al., 2019). The time-series data was the closing price of the iShare
MSCI U.K. exchange-traded fund from 2015 to 2018. The researchers found the Deep Learning
method as the most powerful forecasting tool relative to other ML methods. No company-related data
or macroeconomic variables were used as inputs, so only historical data were used to generate the
predicted outputs. As mentioned in the previous research, Deep Learning can be an efficient
forecasting tool. Other models used to predict stock prices also include the LSTM Deep Learning
network, which utilizes all types of sequential data. Mehtab et al. used historical data from the NIFTY
50 index from 2014 to 2018 to train eight regression models (Mehtab et al., 2021). The LSTM-based
model best predicted future open value using historical data from one week earlier, relative to the
other models. The precision of LSTM demonstrated the effectiveness of Deep Learning in predicting
time-series data. LSTM network was a powerful tool for predicting stock prices in this study.
Unfortunately, this study has only been done for medium-term traders who are concerned with stocks
in the short term. It did not address the long-term profitability of different stocks. Another study has
been done to compare the effectiveness between Ensemble ML methods and single-stage ML
methods (Zhang et al., 2020). These models applied technical indicators as inputs to predict the value
of stock closing prices. Data were collected from previous years, from 2012 to 2017. Technical
indicators describe the trend of past stock prices, which include moving average, transaction volume,
and relative strength index. In this study, SVR-ENANFIS was the two-stage ensemble ML model
with the highest prediction accuracy. However, the problem of this study was that all inputs were
historical data. No outside input related to the stock market or the macroeconomy was used.
As shown in these works, there is a lack of using inputs other than historical stock prices and
technical indicators to make future predictions. Relying on historical data and company-specific data
creates a knowledge gap on how other market forces affect the U.S. stock market at large. Recent
world events and macroeconomic trends have greatly contributed to the volatility of the U.S. Stock
market, such as the outbreak of COVID-19. The COVID-19 pandemic intensified the remnant
volatility of the stock market (Jin et al., 2022). Geopolitical events such as the invasion of Ukraine
also hurt stock indices. Researchers observed a negative relationship between the invasion of Ukraine
and stock returns when they surveyed the stock returns from more than 94 countries after the invasion
(Jin et al., 2022). The recent stock market is highly volatile due to these macroeconomic trends.
Because the stock market and the macroeconomy are interdependent on each other, ignoring
macroeconomic variables will result in inaccurate predictions. To eliminate this knowledge gap, this
232
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
study uses regressors related to the macroeconomy in the Prophet model to forecast the future stock
closing prices.
In this study, we evaluated the forecasting power of Facebook Prophet, NeuralProphet, and
ARIMA. In Facebook Prophet, we can add to influence the prediction. Facebook Prophet is useful
due to its two important features (Taylor & Letham, 2017). Firstly, the model can process a large
amount of data, unlike most statistical models that cannot achieve forecasting at scale. Secondly, the
model achieves analyst-in-the-loop analysis, which enables additional information to be applied to
the model. This feature utilizes both subjective information from the stock and objective information
from the analyst. Taylor et al. found that among different forecasting methods and time series, the
Facebook Prophet had a statistically significant decrease in its prediction error (Taylor & Letham,
2017). The error was lower than the ETX model, the Seasonal Naive method, and the Tbats model.
In addition, the Facebook Prophet model can analyze weekly and yearly seasonality trends. Facebook
Prophet made accurate predictions based on time-series data and statistical parameters in past
experiments (Christy Jackson et al., 2021). NeuralProphet is a combination of the Prophet model and
Neural Network (Sahay & Amudha, 2020). Based on previous experimental results, the Deep
Learning method is suitable for time-series forecasting. The NeuralProphet model can address the
needs of all kinds of traders. Including day-traders, medium-term traders, long-term investors, and
wealth management companies. NeuralProphet is also less complicated when comparing to other
Deep Learning methods. These more complicated methods are ANN and LSTM. Average traders do
not have an abundant ML experience, so NeuralProphet is more accessible for them than ANN and
LSTM.
Our marginal contribution can be summed up as follows: First, a Facebook Prophet model that
correctly incorporated multi-macroeconomic regressors is suggested. To our knowledge, this is the
first time the Facebook Prophet model based on multi-macroeconomic regressors has been employed
for predicting stock price, and it fully utilizes the strengths of multi-macroeconomic regressors and
the Facebook Prophet model.
233
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
Time-series Forecasting
Output: Future
Stock Closing Prices
on time interval t+1
End
234
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
Network and Long short-term memory. NeuralProphet is a Deep Learning method because it contains
many hidden layers and nodes. A trend is formed when NeuralProphet detects the changepoints in a
dataset. Holiday effects mean that special events are automatically processed as covariates of
NeuralProphet. Seasonality can be modeled after the Fourier series, so the function for the dataset is
periodic. The auto-regressive aspect of NeuralProphet allows it to predict future values based on past
values with AR-Net. Statistically, it is a model for lagged regression. The function of an
autoregressive model in order of p is written out below:
𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑡𝑡 = 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 + 𝛽𝛽 ∗ 𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑂𝑡𝑡−1 + 𝐼𝐼𝐼𝐼𝐼𝐼𝐼𝐼𝐼𝐼𝑡𝑡−1 + 𝜇𝜇𝑖𝑖
The dataset is processed before fitting on NeuralProphet. The pre-processed dataset only includes
the date and the corresponding Meta closing price. No macroeconomic regressor is used for this model.
3.4 ARIMA Model
The autoregressive integrated moving average model (ARIMA), a time-series modeling method
proposed by Box Jenkins (Box & Jenkins, 1970) is virtually an extension of the autoregressive
moving average model (ARIMA). Accordingly, the paper applies the ARIMA model to the prediction
residual of the three fuzzy information particles in PPI monthly time-series data to correct the
deviation of GA-SVR, and the ARIMA model can be expressed as
𝑝𝑝 𝑞𝑞
and S&P 500 index are the five regressors. Section 4.2 details the way regressors are added to the
Facebook Prophet model.
5-Year Forward Inflation Expectation Rate: The U.S. inflation rate measures the rate of the rising
price levels in the U.S. economy. The rate of inflation is generally used as an indicator of the overall
health of the macroeconomy. A high inflation rate tends to have a negative impact on the stock market
as consumers are losing purchasing power and have a decreased wealth level. Consumer expectations
about future inflation rates would affect investing behavior, so Inflation Expectation Rate is
appropriate to use as a macroeconomic regressor for forecasting stock prices.
Economic Policy Uncertainty Index for United States: The U.S. Economic Policy Uncertainty
Index (EPU) is collected from Federal Reserve Economic Data. The index was developed by
assessing newspaper coverage frequency; newspaper archives were used during this process (Baker
et al., 2016). The study suggested a negative relationship between increased EPU and macro-level
performance.
Geopolitical Risk Index: The Geopolitical Risk Index (GPR) used in this study was constructed
based on 25 million news articles from the 20th century to the present, accessed from the electronic
archives of important newspaper institutions (Caldara & Iacoviello, 2022). These institutions
included New York Times, the Washington Post, The Wall Street Journal, and more. The study found
that an elevated level of GPR relates to lower investment. In this study, GPR is used as one of the
multi-macroeconomic regressors due to the effect it has on the equity market.
10-Year Treasury Constant Maturity Minus 2-Year Treasury Constant Maturity: The percentage
of 10-year treasury yield help investors make accurate predictions on stock performance. A higher
yield means higher demand for the treasury, corresponding to a volatile stock market. The opposite
is true. The market yield for 10-year maturity treasury securities is added as a regressor so that the
Facebook Prophet model increase forecasting precision.
S&P 500 index: Investors most often view the S&P 500 index as a benchmark for stock market
performance. S&P 500 is cap-weighted, featuring the 500 largest U.S. companies. The index includes
companies from all industries, making S&P 500 the leading stock index. Therefore, S&P 500 index
is added as a regressor for Facebook Prophet.
4. Experimental Results
4.1 Visualizations and Analysis of Forecasting Results by FB Prophet, NeuralProphet, and
ARIMA
236
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
237
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
In this research, 75% of the data is considered for the training set, and 25% is considered for the
testing set. The four models produced four graphs, showing the past closing prices and the predicted
future stock closing prices. Figure 3 shows the actual stock closing price from January 1st, 2018, to
December 31st, 2021. Figures 4, 5, and 7 are graphed in R, but Figure 6 is graphed in Python. The
volatility of Meta stocks is shown in these graphs. Figure 3 is used as a benchmark because it shows
the true values of the stocks.
In Figures 4 and 5, the black dots display the actual closing prices from January 1st, 2018, to
December 31st, 2020. The black line in Figure 7 represents the actual closing price from January 1st,
2018, to December 31st, 2020, for the ARIMA model. There is no black line or dots in Figure 6
because NeuralProphet only graphs the predicted values and trends.
The blue lines in Figure 4 and 5 represents the predicted trend of Meta’s closing prices from
January 1st,2021, to December 31st, 2021. Figure 6’s blue line represents the NeuralProphet’s
predicated stock price from January 1st, 2021, to December 31st, 2021. The blue lines are the Y hat
values, which are the predicted y values in the regression equation. The Y hat values are the stock
closing prices generated by the regression of the ML models.
Of the four models, Facebook Prophet with multi-macroeconomic regressors (Fig. 4) graphs the
stock trend that most closely resembles the true value of the stock closing price (Fig. 3). The blue
trend in Figure 4 is the closest to the actual stock price trend graphed in Figure 3. The blue lines in
Figures 5 and 6 are similar, indicating the baseline Prophet model and NeuralPropeht have similar
prediction accuracy. The blue shaded areas in Figures 4, 5, and 7 indicate the range of the forecasting
error. Facebook Prophet model with multi-regressors produces the smallest margin of error, shown
in Figure 4. The margin of error is the largest in Figure 7, showing ARIMA’s low forecasting accuracy.
The empirical results indicate that the Facebook Prophet model with multi-macroeconomic regressors
make the most accurate predictions compared to the other models.
238
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
Figure 8-10 presents the different components and trends of the Prophet model. As mentioned in
Section 3, the Prophet model deconstructs the time-series data into weekly and yearly trends.
The growth trend shows slower growth in Figure 7 compared to the growth trend in Figure 8. This
change is due to the additive regressors applied to Facebook Prophet model in Figure 7. Any negative
macroeconomic conditions can hinder growth in the stock market. NeuralProphet constructs a linear
growth trend, shown in Figure 9.
The yearly seasonality trends are volatile in all three figures. All three figures show that Meta stock
performs well from July to September. The performance of Meta is poor from January to April,
according to the yearly trends in all figures. Each figure shows a decreasing trend from September to
January and an increasing trend from April to July.
The weekly seasonality trends are not volatile in any of the models. Weekly trends are stagnant in
all three figures, meaning relatively low weekly volatility for the Meta stock.
4.3 Evaluation Metrics / Models Performance Comparison
Table 1. Forecasting Accuracy Evaluation
Model RMSE MAPE MAE SMAPE
Facebook Prophet with multi-
23.278 0.052 14.083 0.050
macroeconomic regressors
Facebook Prophet with no regressor 42.336 0.065 31.891 0.094
NeuralProphet with no regressor 41.026 0.109 34.444 0.101
ARIMA with no regressor 59.352 0.151 51.292 0.167
We use four evaluation indices to assess the forecasting accuracy of the four models we proposed.
These indices are root mean square error (RMSE), mean absolute percentage error (MAPE), mean
absolute error (MAE), and symmetric mean absolute percentage error (SMAPE). These metrics are
calculated using two sets of values, the predicted stock prices, and the actual stock prices. The
predicted stock prices are the Y hat values. The actual stock prices are obtained from Yahoo Finance.
Table 1 shows that Facebook Prophet with multi-macroeconomic regressors has the lowest value
for each evaluation metric. The predicted closing prices done by the Prophet model with multi-
macroeconomic regressors are the closest to the actual daily Meta closing prices in 2021. In other
words, this model’s Y hat values are the closest to the actual stock closing values. The proposed
model has an RMSE of 23.27807, so its forecasting error is not greatly spread out from the regression
line. MAPE is scale-independent, but the scale is the same for all four models in this experiment.
MAE is the scale-dependent KPI. Prophet with multi-macroeconomic regressors produces a low
MAPE and MAE values. The low average forecasting error indicates this model’s high accuracy.
MAE reduces by more than 50% going from the second and third model to the first model in the table,
so the error rate decreases significantly when we added regressors to the Prophet model.
Facebook Prophet model with no regressor has a higher RMSE than NeuralProphet. However, the
baseline Prophet model’s other error values are lower than those of NeuralProphet. Neuralprophet
has higher MAPE, MAE, and SMAPE than the Prophet model with no regressors. Both models are
better at predicting time-series data than the ARIMA model. The evaluation metrics reveal that
prediction done by ARIMA produces the lowest accuracy. Its RMSE, MAPE, MAE, and SMAPE are
the highest out of the four models. The forecasting error of ARIMA is significant.
Results of experiments reveal that the Facebook Prophet model with multi-macroeconomic
regressors achieve lower RMSE, MAPE, MAE, and SMAPE relative to the NeuralProphet and
ARIMA models, indicating that the proposed Facebook model with multi-macroeconomic regressors
is an effective and novel approach for the prediction of stock price.
240
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
5. Conclusion
Geopolitical conflicts, rising expectations of a nationwide recession, and occurrence of a global
pandemic are having a negative impact on the U.S. stock market. The rocky performance of the stock
market has raised concerns for many investors. To predict the unpredictability of the stock market,
ML models that accurately predict stock prices is needed. This paper directly addresses this need by
using four ML models to forecast. These four models are Facebook Prophet, NeuralProphet and
ARIMA. Five macroeconomic regressors have been applied to Facebook Prophet. This is done to
find out how macroeconomic variables can help investors understand the stock market. The
experiment aims to create transparency for investors in order to grow their investment. In this
experiment, datasets are prepared in R. The closing price of Meta Platforms are used. All four models
conducted one year forward forecasting. Baseline Prophet model, NeuralProphet model and ARIMA
model serve as secondary models of forecasting, to compare the results with Facebook Prophet with
regressors. Facebook Prophet with five regressors prove to be the most accurate prediction model as
it achieves the lowest RMSE, MAPE, MAE, and SMAPE among all four models. The results
demonstrate the effectiveness of using five macroeconomic regressors in predicting stock. The
macroeconomic variables have a positive effect on predicting future stock prices. In future studies,
different macroeconomic data should be considered. For example, unemployment data, M2 Money
Supply, and Economic Growth rate are all macroeconomic factors that can influence stock price
prediction. Other ML models should also be included in future studies to compare results with the
Prophet model with regressors.
References
[1] Aditya Satrio, C. B., Darmawan, W., Nadia, B. U., & Hanafiah, N. (2021). Time series analysis and
forecasting of coronavirus disease in Indonesia using Arima model and prophet. Procedia Computer
Science, 179, 524–532. https://doi.org/10.1016/j.procs.2021.01.036.
[2] Ampomah, E. K., Qin, Z., & Nyame, G. (2020). Evaluation of tree-based ensemble machine learning
models in predicting stock price direction of movement. Information, 11(6), 332.
https://doi.org/10.3390/info11060332.
[3] Ariyo, A. A., Adewumi, A. O., & Ayo, C. K. (2014). Stock price prediction using the Arima model. 2014
UKSim-AMSS 16th International Conference on Computer Modelling and Simulation.
https://doi.org/10.1109/uksim.2014.67.
[4] Baker, S. R., Bloom, N., & Davis, S. J. (2016). Measuring economic policy uncertainty*. The Quarterly
Journal of Economics, 131(4), 1593–1636. https://doi.org/10.1093/qje/qjw024.
[5] Boungou, W., & Yatié, A. (2022). The impact of the Ukraine–russia war on world stock market returns.
Economics Letters, 215, 110516. https://doi.org/10.1016/j.econlet.2022.110516.
[6] Box, G. and Jenkins, G. (1970) Time Series Analysis: Forecasting and Control. Holden.
[7] Day, San Francisco.
[8] Caldara, D., & Iacoviello, M. (2022). Measuring geopolitical risk. American Economic Review, 112(4),
1194–1225. https://doi.org/10.1257/aer.20191823.
[9] Christy Jackson, J., Prassanna, J., Abdul Quadir, M., & Sivakumar, V. (2021). Stock market analysis and
prediction using time series analysis. Materials Today: Proceedings.
https://doi.org/10.1016/j.matpr.2020.11.364.
[10] Dash, S., Chakraborty, C., Giri, S. K., & Pani, S. K. (2021). Intelligent computing on time-series data
analysis and prediction of COVID-19 pandemics. Pattern Recognition Letters, 151, 69–75.
https://doi.org/10.1016/j.patrec.2021.07.027.
[11] Jana, R. K., Ghosh, I., & Wallin, M. W. (2022). Taming energy and electronic waste generation in bitcoin
mining: Insights from Facebook Prophet and Deep Neural Network. Technological Forecasting and Social
Change, 178, 121584. https://doi.org/10.1016/j.techfore.2022.121584.
241
BCP Business & Management EMEHSS 2022
Volume 25 (2022)
[12] Jin, L., Zheng, B., Ma, J., Zhang, J., Xiong, L., Jiang, X., & Li, J. (2022). Empirical study and model
simulation of Global Stock Market Dynamics during COVID-19. Chaos, Solitons & Fractals, 159, 112138.
https://doi.org/10.1016/j.chaos.2022.112138.
[13] Liu, H., & Long, Z. (2020). An improved deep learning model for predicting stock market price time
series. Digital Signal Processing, 102, 102741. https://doi.org/10.1016/j.dsp.2020.102741.
[14] Mehtab, S., Sen, J., & Dutta, A. (2021). Stock price prediction using machine learning and LSTM-based
deep learning models. Communications in Computer and Information Science, 1336, 88–106.
https://doi.org/10.1007/978-981-16-0419-5_8.
[15] Nikou, M., Mansourfar, G., & Bagherzadeh, J. (2019). Stock price prediction using deep learning
algorithm and its comparison with machine learning algorithms. Intelligent Systems in Accounting,
Finance and Management, 26(4), 164–174. https://doi.org/10.1002/isaf.1459.
[16] Parray, I. R., Khurana, S. S., Kumar, M., & Altalbe, A. A. (2020). Time series data analysis of stock price
movement using Machine Learning Techniques. Soft Computing, 24(21), 16509–16517.
https://doi.org/10.1007/s00500-020-04957-x.
[17] Sahay, A., & Amudha, J. (2020). Integration of prophet model and convolution neural network on
Wikipedia trend data. Journal of Computational and Theoretical Nanoscience, 17(1), 260–266.
https://doi.org/10.1166/jctn.2020.8660.
[18] Taylor, S. J., & Letham, B. (2017). Forecasting at scale. https://doi.org/10.7287/peerj.preprints.3190v1
[19] Tsai, C. F., & Wang, S. P. (2009). Stock Price Forecasting by Hybrid Machine Learning Techniques.
Proceedings of the International MultiConference of Engineers and Computer Scientists, 1.
https://doi.org/http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.149.970&rep=rep1&type=pdf.
[20] Zhang, J., Li, L., & Chen, W. (2020). Predicting stock price using two-stage machine learning techniques.
Computational Economics, 57(4), 1237–1261. https://doi.org/10.1007/s10614-020-10013-5.
242