Forecasting Lebanese Stocks Using Arima Models
Forecasting Lebanese Stocks Using Arima Models
Abstract. This paper presents method of building ARIMA model for stock price prediction.
The experimental results obtained with best ARIMA model to predict stock exchange on
short-run basis with aim to guide investors in stock market, to create profitable investment
selections. In this article our analysis and forecasting are focused on the price of three
shares of three different sectors, SOLA (Solidere Company, development and reconstruc-
tion sector), BYB (Byblos bank, Banking sector) and HOLC (Holcim Liban, industrial
sector). The three companies were selected based upon the market capitalization by sec-
tors of activities in the Beirut Stock Exchange (BSE) and their role on Lebanese economic
development. The taken data of the price of three shares of three different sectors from
29th April 2021 to April 29, 2022, and predict the future prices until the end of May
5, 2022, using ARIMA model. Using the standard model selection criteria such as AIC,
BIC, log-likelihood and SigmaSQ we diagnosed the forecasting performance of various
ARIMA models with a view to determining the best ARIMA model for predicting stock
market in each sector under investigation. The outcome of the empirical analysis indicated
that ARIMA (1,1,1), ARIMA (1,1,1) and ARIMA (1,1,2) models are respectively the best
forecast models for BYB and HOLC and SOLA.
Key words: time series analysis; modeling; autoregressive integrated moving average
(ARIMA); forecasting; stocks.
Paper submitted: February 27, 2023
For citation: Nasser Aldine A. A. Forecasting Lebanese stocks using ARIMA models.
Digital models and solutions. 2023. Vol. 2, no. 1. DOI: 10.29141/2782-4934-2023-2-1-1.
EDN: VWIFAL.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
Introduction
Over the past years, the researchers have been interested in studying of stock market per-
formance and its trends to predict various outcomes by means of statistical modeling The
most efficient way to forecast is to understand the present scenarios. The mathematical and
statistical method of time series analysis is used to explain natural events and their behavior
through time. Forecasting financial time series such as stock market has drawn considerable
attention among applied researchers because of the vital role which stock market play on the
economy of any nation. Forecasting stock indices is very difficult because the market indices
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
are highly fluctuating as result of increase or decrease that characterize the stock price. Fluc-
tuations are affecting the investor’s belief. Determining more effective ways of stock market
index prediction is important for stock market investors to make more informed and accurate
investment decisions.
To date, autoregressive integrated moving average (ARIMA) model is the mostly widely
used time series model for forecasting stock market series. The key factor behind the pro-
posed method is the lack of a statistically significant correlation between market parameters
and the target price of closing. Perhaps because of the reality that if the prospect market worth
of the stocks is effectively expected, the depositors can be driven, the idea of forecasting stock
market return has become very popular.
Looking to the literature review of ARIMA models, we can easily see that ARIMA models
are applied to analyze and forecast time series data in much empirical research. Paul et al. [1]
seek to determine the best ARIMA model for forecasting the average daily share price indices
for shares of a pharmaceutical company in Bangladesh, their study utilized AIC, SIC, AME,
RMSE and MAPE as the selection criteria. Upon testing several models, the study found
ARIMA (2,1,2) to be the best model for forecasting the shares of the pharmaceutical company.
Likewise, Wahyudi [2] attempted to predict stock price volatility of equities that are listed on
the Indonesia Stock Exchange using the ARIMA model. Whilst using the Indonesia Compos-
ite Stock Price Index, results of the empirical analysis evidenced that the best ARIMA model
was (0, 0, 1). This model was determined based on the AIC criterion.
Also, from an agricultural perspective, Jadhav et al. [3] applied univariate ARIMA tech-
niques to forecast and validate farm prices of cereals in Karnataka state, India. Upon analysis,
the study made pragmatic findings that suggested that the ARIMA model is empirically ap-
plicable for forecasting and validating farm prices of cereal crops. Similarly, Fattah et al. [4]
seek to model and forecast the sales demand for the products sold by a food company, using a
time series approach. The study which utilized past demand information of customer purchas-
es, tested several ARIMA models to forecast and anticipate future demand. Based on the AIC,
SBC, maximum likelihood and standard error criteria, the study found the ARIMA (1,0,1) as
the best model to predict future demand for food products of the company.
From a macroeconomic perspective, Abonazel & Abd-Elftah [5] sought to develop an ap-
propriate ARIMA model to forecast and validate the Egyptian annual gross domestic product
(GDP). Upon utilizing the Box-Jenkins approach, the researchers noted the ARIMA (1,2,1)
as the most suitable model for forecasting and validating Egyptian annual GDP. Alsharif et al.
[6] utilized ARIMA models for both daily and monthly solar radiation in Seoul, South Korea,
using solar radiation data. Through a critical empirical analysis, the findings of the study sug-
gested that while ARIMA (1,1,2) model can be used to predict daily solar radiation, ARIMA
(4,1,1) model can be effectively used to predict monthly solar radiation.
Eke [7] asserted that the ARIMA (2,0,3) is the best fit model for predicting the Nigerian
Stock Exchange monthly stock market returns over a ten-year period. This assertion was
based on the use of the Box-Jenkins technique, as well as the AIC and MSE performance
criteria. In a similar study, Mustapa & Ismail [8] sought to develop an appropriate ARIMA
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
model that best fits the S&P 500 monthly stock prices for a 17-year period to enhance portfo-
lio and investment decision making. Upon testing several models, the study found the ARIMA
(2,1,2) and GARCH (1,1) as the most appropriate models for predicting the S&P 500 monthly
stock prices.
At the early period of the Covid-19, Alzahrani et al. [9] sought to forecast the daily increas-
es of cases in Saudi Arabia and the possibility of the Umrah & Hajj Pilgrimages 2020. The re-
searchers utilized four different prediction models: the AR model, MA model, ARMA model
and ARIMA model. Upon testing all models, the study found the ARIMA model to explicate
the best predictive power amongst other models. The ARIMA model further predicted the
suspension of the Umrah & Hajj Pilgrimages, 2020.
In a likewise context, Singh et al. [10] utilized the ARIMA model to predict the spread
trajectories as well as mortalities of COVID-19 in the top 15 countries as of April 2020. The
study utilized the model to forecast the spread of the virus and its associated mortalities for
the subsequent two months. The findings suggested a decline in both cases and associated
mortalities in China, Switzerland, and Germany. However, it was predicted that countries
such as the United States, Spain, Italy, France, and the United Kingdom will witness increases
in the spread of the virus as well as its associated mortalities Singh et al. [10].
Research Methodology
A quantitative research design was adopted for this study and the data used was collected
from the investing website on Stocks prices series within 29th April 2021 to 29th April 2022
in Beirut Stock Exchange. The selected stocks data were based on data availability and the
sampling technique is purposive. The method of data analysis for this paper is descriptive
statistics (using mean and standard deviation for the data summary) and time series using unit
root test to test for stationarity of the Stock’s price series and the autoregressive integrated
moving average (ARIMA) to predict the future values of the Stock’s price rate in Beirut Stock
Exchange. The ARIMA model was developed by Box and Jenkins. It is also known as the
Box-Jenkins methodology which consists of some major steps as identifying, estimating, and
diagnosing.
In financial forecasting, the model is one of the most widely used approaches Pai & Lin
[11]; Merh et al. [12]. ARIMA models have demonstrated their efficient ability to produce
short-term predictions. In terms of short-term prediction, it consistently outperformed com-
plicated structural models Meyler et al. [13]. The ARIMA model consists of several steps
such as identification, estimation, diagnostic and forecast.
Identification of the model, this involves selecting the most appropriate lags for the AR and
MA parts, as well as determining if the variable requires first-differencing to induce station-
arity. The ACF and PACF are used to identify the best model. (Information criteria can also
be used).
Estimation, this usually involves the use of a least squares estimation process.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
Diagnostic testing, which usually is the test for autocorrelation. If this part is failed then
the process returns to the identification section and begins again, usually by the addition of
extra variables.
Forecasting, the ARIMA models are particularly useful for forecasting due to the use of
lagged variables.
The statistical software used for the analysis of this paper is EViews version 12.0.
The unit root test, also known as the stationarity test, indicates the presence of a unit root
when the series lacks stationarity and may lead to spurious results and the absence of a unit
root when there is a presence of stationarity in the series. To resolve the problem of spurious
results, the unit root test is accomplished using the augmented Dickey–Fuller test (ADF). The
hypothesis to accomplish the unit test can be stated as:
H0: there is a presence of a unit root (series is not stationary) vs Ha: there is no unit root
(the series is stationary). The ADF test can be presented mathematically as:
∆Yt = θ + γYt – 1 + ∑pi = 1βiYt – i + ωt.
Model specification
ARIMA model is generally expressed in the form (p, d, q) which was built from the com-
bination of three building blocks, namely, p for Autoregressive (AR), d for Integration order
term (I) and q for Moving Average (MA) for modeling the serial correlation in the disturbance.
This means that ARIMA considers both the past values (AR) and the mean residuals of the
error term (MA).
The general Autoregressive (AR (p)) of order p can be expressed below as:
yt = Yt + Φ1Yt – 1 + Φ2 Yt – 2 + ... ΦP Yt – P + εt. (1)
Hence, ARIMA process of order (p, d, q) can be specify using backward shift operator as:
Φ(B) Δd yt = δ + θ(B)εt; (4)
Φ(B) = 1 – φ1B – φ1B2 – … … – φpBp; (5)
θ(B) = 1 – B1B – B2B2 – … … – θ2B2. (6)
Where Φ(B) is the autoregressive operator while θ (B) is the moving average operator
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
Stationarity test
The Stock’s price series during 29 April 2021–29th April 2022 are plotted is Figure 1.
th
It shows that all the stocks maintain unstable pattern in their stock’s growth. The result of
the stationarity test (ADF test and KPS test) on the data is given in Table 2.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
Figure 1. The Stock’s price series during 29th April 2021–29th April 2022
ADF and KPS test is greater than the critical value of the significance level of 0.01, 0.05
and 0.1, It should be highlighted that both the ADF test and the KPS test fail to reject the null
hypothesis at the original data, that is to say, the original stocks sequence is non-stationary.
The observed time series were transformed to bring them to the stationary process. Since
there is an anomalous value in this series because the series contain missing value which was
replaced by interpolation methods to prevent the results from being distorted.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
However, ADF and KPS are less than the three critical values of the test level. That is to
say, the ∆logBYB and ∆logHOLC and ∆logSOLA sequence after the logarithmic change and
the first-order difference is a stationary series, and the significance test of the stationarity is
passed.
Model identification
With the EViews software, the autocorrelation and partial autocorrelation function graphs
of the series are plotted in Figure 2.
From the autocorrelation and partial autocorrelation function graphs of the series. For
∆logBYB price, the 1st and 2nd lag in partial autocorrelation graph are above the confidence
band so p = 1 or p = 2. To determine the order of the autoregressive component,the 1st lag is
greater than confidence band in autocorrelation graph so q = 1. In order to determine the or-
der of moving average component for ∆logHOLC price, the 1st lag in partial autocorrelation
is above the confidence band so p = 1 to determine for autoregressive component, 1st lag is
greater than confidence band in autocorrelation graph so q = 1, while for ∆logSOLA price,
the 1st and 2nd lag in partial autocorrelation are above the confidence band so p = 1 or p = 2 in
order to determine the order of the autoregressive component, and 1st and 2nd lag are greater
than confidence band in autocorrelation graph so q = 1 or q = 2 in order to determine the order
of moving average component. Considering that the judgment is very subjective, to establish
a more accurate model, the range of values of p and q is approximately relaxed and multiple
ARMA (p, q) models are established. The order with 0, 1, 2 in autoregressive moving average
pre-estimation is performed on the processed samples data. Table below lists the test results
of ARMA (p, q) for different parameters. Adjusted R-squared, AIC value, SC value and S.E.
of regression are all important criteria for selecting models. The AIC criterion and the SC
criterion are mainly used for ranking and select the optimal model. Generally, the larger the
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
coefficient of determination, the smaller the AIC value and the SC value, and the residual
variance, the corresponding ARMA (p, q) model is superior.
It should be emphasized that although the appropriate ARIMA model is usually selected
using the AIC value and the SC value. However, the minimum AIC value and the SC value
are not sufficient conditions for the optimal ARMA model, therefore I must go further with
uses of SigmaSQ (volality measure) and log-likelihood. I take smallest value in SigmaSQ
(volality measure) and biggest value for log-likelihood.
In Table 3, the model that did pass the parameter significance test and the residual random-
ness test was identified by “*”. Finally, it is preferable to prefer the ARMA (1,1) model in
∆logBYB and ∆logHOLC time series and ARMA (1,2) model in ∆logSOLA time series.
Table 3. AIC and SC criterion
Variables (pq) SigmaSQ AIC SC Log-likelihood
∆logBYB (1,1)* 0.000282* -5.282298* -5.22628* 669.5696*
price (0,1) 0.000294 -5.272451 -5.244440 666.3288
(1,0) 0.000381 -5.018534 -4.990523 634.3353
(1,2) 0.000290 -5.27009 -5.21407 668.0312
(2,1) 0.000293 -5.26048 -5.20446 666.8205
(2,2) 0.000458 -4.81989 -4.76386 611.3056
∆logHOLC (1,0) 0.000038 -7.306264 -7.278253 922.5893
price (1,1)* 0.000053 -7.341898* -7.285876* 929.0792*
(0,1) 0.000038 -7.330693 -7.302681 925.6673
(1,2) 0.000037* -7.32054 -7.267032 926.7048
(2,1) 0.000038 -7.320109 -7.264086 926.3338
(2,2) 0.000041 -7.224685 -7.168662 914.3103
∆logSOLA (1,1) 0.000297 -5.250195 -5.194172 665.5245
price (1,0) 0.000318 -5.198271 -5.170260 656.9822
(0,1) 0.000313 -5.216174 -5.188162 659.2379
(1,2)* 0.000296* -5.253168* -5.197147* 665.8992*
(2,1) 0.000304 -5.227915 -5.171893 662.7173
(2,2) 0.000305 -5.223585 -5.167562 662.1717
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
For the
Δ logBYBt = –0.000168 + 0.204789Yt – 1 – 1.000εt – 1 + εt;
(−8.1765) (3.427493) (–0.018386)
The estimated value of the variance of the corresponding error term is 0.016939.
It can be seen from the t statistic of the model coefficients and AR(1) and its P value of the
parameter estimates are significant at the significance level of 0.01 while the MA(1) and its
parameter isn’t significant.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
The estimated value of the variance of the corresponding error term is 0.006107.
The P value of AR(1) and MA(1) parameters estimates are significant at the significance
level of 0.01 while the constant parameter isn’t significant.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
However, after I have selected the best models, I ensured that the model satisfies the re-
quirements to forecast and predict the future values, therefore the model satisfied the follow-
ing:
• No autocorrelation, i. e. Residual of the model are white noise (Ljung-Box Q statistic)
(Figure 9).
• Satisfied stability condition, i. e. the inverse roots must lie inside the unit circle (Figure 10).
A white noise test is performed on the residual after fitting the models. The autocorrelation
and partial autocorrelation function graphs of the residual series show that the residual is a
white noise since all the graphs are within the confidence bound, this indicating that the model
is valid for estimation and forecasting.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
Also, by plotting the inverse roots we can see that all the inverse roots lie inside the unit
circle. The models satisfied the stability conditions, and the error terms are white noise.
Data forecasting
Under the graphical interface in EViews software, Dynamic forecast mode is used to pre-
dict the Stocks values from 1-May-2022 to 5-May-2022. The results are listed in Table 7.
From the plot above we can conclude that HOLC and SOLA stock exchange will be in-
creasing as the days go, while BYB stock price will be decreasing as the days go.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
Conclusion
The study aims to investigate the application of autoregressive integrated moving averages
(ARIMA) for forecasting the prices of some stocks of Beirut Stock Exchange. The outcome
of the empirical analysis indicated that ARIMA (1,1,1), ARIMA (1,1,1) and ARIMA (1,1,2)
models are the best forecast models for BYB (Byblos bank, Banking sector), HOLC (Holcim
Liban, industrial sector) and SOLA (Solidere Company, development and reconstruction sec-
tor) respectively.
It was suggested that the Lebanese stock market performance made it possible to forecast
the stock prices. However, the suggestion made here may has certain limitation because the
data in the study has many missing values, which was auto filled with uses of interpolation
method and the results obtain may not reliable since the data isn’t original data. The high
requirements for forecast results and the uncertainty of the situation have led to the need for
adaptive forecasting methods and will prompt a significant amount of further additional re-
search in the Lebanese stock market.
Источники
1. Paul, J. C., Hoque, M. S., & Rahman, M. M. (2013). Selection of best ARIMA model for
forecasting average daily share price index of pharmaceutical companies in Bangladesh:
a case study on Square Pharmaceutical Ltd. Global Journal of Management and Business
Research, 13(3), 14–26.
2. Wahyudi (2017). Time series model and forecast of GDP per capita in Tianjin. Northern
Economy, 3, 44–46.
3. Jadhav, V., Chinnappa, R. B., & Gaddi, G. (2017). Application of ARIMA model for fore-
casting agricultural prices. Journal of Agricultural Science and Technology, 19, 981–992.
4. Fattah, J., Ezzine, L., Aman, Z., El Moussami, H., & Lachhab, A. (2018). Forecasting of
demand using ARIMA model. International Journal of Engineering Business Manage-
ment, 10, 1–9. https://doi.org/10.1177/1847979018808673.
5. Abonazel, M. R., & Abd-Elftah, A. I. (2019). Forecasting Egyptian GDP using ARI-
MA models. Reports on Economics and Finance, 5(1), 35–47. https://doi.org/10.12988/
ref.2019.81023.
usue-journal.ru
Т. 2 • № 1 • 2023 • Vol. 2 • No. 1 ISSN 2782-4934 (online)
6. Alsharif, M. H., Younes, M. K., & Kim, J. (2019). Time series ARIMA model for predic-
tion of daily and monthly average global solar radiation: the case study of Seoul, South
Korea. Symmetry, 11(2), 240. https://doi.org/10.3390/sym11020240.
7. Eke, C. N. (2019). Time series analysis on monthly stock market returns of the Nigerian
stock exchange: an ARIMA modeling approach. Asian Journal of Economics, Business
and Accounting, 11(4), 1–9. https://doi.org/10.9734/AJEBA/2019/v11i430138.
8. Mustapa, F. H., & Ismail, M. T. (2019). Modelling and forecasting S&P 500 stock prices
using hybrid Arima-Garch Model. Journal of Physics: Conference Series, 1366, 012130.
https://doi.org/10.1088/1742-6596/1366/1/012130.
9. Alzahrani, S. I., Aljamaan, I. A., & Al-Fakih, E. A. (2020). Forecasting the spread of the
COVID-19 pandemic in Saudi Arabia using ARIMA prediction model under current pub-
lic health interventions. Journal of Infection and Public Health, 13(7), 914–919. https://
doi.org/10.1016/j.jiph.2020.06.001.
10. Singh, R. K., Rani, M., Bhagavathula, A. S., Sah, R., Rodriguez-Morales, A. J., Kalita, H.,
Nanda, C., Sharma, S., Sharma, Y. D., Rabaan, A. A., Rahmani, J., & Kumar, P. (2020).
Prediction of the COVID-19 pandemic for the top 15 affected countries: advanced autore-
gressive integrated moving average (ARIMA) model. JMIR Public Health and Surveil-
lance, 6(2), e19115. https://doi.org/10.2196/19115.
11. Pai, P. F., & Lin, C. S. (2005). A hybrid ARIMA and support vector machines model in stock
price forecasting. Omega, 33(6), 497–505. https://doi.org/10.1016/j.omega.2004.07.024.
12. Merh, N., Saxena, V. P., & Pardasani, K. R. (2010). A comparison between hybrid ap-
proaches of ANN and ARIMA for Indian stock trend forecasting. Business Intelligence
Journal, 3(2), 23–43.
13. Meyler, A., Kenny, G., & Quinn, T. (1998). Forecasting Irish inflation using ARIMA mod-
els. Dublin.
Информация об авторах
Абдо Али Нассер Альдин, аспирант. Белорусский государственный экономиче-
ский университет, 220070, Республика Беларусь, г. Минск, Партизанский проспект, 26.
E-mail: [email protected].
usue-journal.ru