The determinants of main stock exchange index changes in emerging countries: evidence from Turkey in COVID-19 pandemic age

With the emergence and spreading of COVID-19 pandemic all over the world, the uncertainty has been increasing for countries. Depending on this condition, especially emerging countries have been affected negatively by foreign portfolio investment outflows from stock exchanges, and main stock exchange indices have been collapsed. The study examines the causes of the main stock exchange index changes in Turkey in the COVID-19 period. In this context, 14 variables (3 global, 6 country-level, 5 market-level) are analyzed by employing random forest and support vector machine algorithms and using daily data between 01.02.2020 and 05.15.2020, which includes the pre-pandemic and the pandemic periods. The findings prove that (i) the most important variables are the retention amount of foreign investors in the equity market, credit default swap spreads, government bonds interest rates, Morgan Stanley Capital International (MSCI) emerging markets index, and volatility index in the pre-pandemic period; (ii) the importance of variables changes as MSCI emerging markets index, the volatility index, retention amount of foreign investors in the equity market, amount of securities held by the Central Bank of Republic of Turkey (CBRT), equity market traded value in the pandemic period; (iii) support vector machine has superior estimation accuracy concerning random forest algorithms in both pre-pandemic and pandemic period.


Introduction
The development of countries depends on mainly the improvement of both the real and financial sectors. The main role of financial sectors is to finance economic activities in countries. Therefore, it could be said that financing has an important role in the development of countries.
All countries including both developed and emerging have been trying to sustain economic growth by providing monetary (finance) resources for commercial activities. However, unlike developed countries, emerging countries need much more financing.
Countries can provide financing from internal (national/domestic) and external (international/foreign) sources. Foreign sources become important when domestic savings are not sufficient. Thus, the condition of emerging countries is such. Therefore, emerging countries have been trying to increase foreign direct investments and portfolio investments (Karikari, 1992;Zengin et al., 2018).
Achieving financial stability through stabilizing fiscal, monetary (price), macroeconomic, and macro prudential indicators is quite significant in stimulating foreign investments. Foreign investors consider country risks in allocating funds among different asset opportunities to benefit from diversification (Dooley & Hutchison, 2009;Yang et al., 2018) by considering that the world has been making countries much more interdependent and this increases risks. In this context, there are a variety of indicators like credit default swap (CDS) spreads, foreign exchange rates (FER), foreign investors' shares and net buying amount in equity markets, interest rates, oil prices, etc. All of these indicators are significant in terms of roles and effects in economies (Orhan et al., 2019) for the development of emerging countries by affecting foreign investors' decisions. Therefore, activities of foreign investors are expected to make effects on the countries' (Hargis & Ramanlal, 1997;Bekaert & Harvey, 2003;Gümüş, 2010), stock exchange indices. Although increasing foreign direct investments is not so easy because it is related to so many geopolitical and political issues, stimulating foreign portfolio investments via bonds, bills, and equities is much easier.
On the other hand, COVID-19 is a very recent phenomenon that affects all countries deeply. It was originated from China, became pandemic at the beginning of 2020, and has been spreading all over the World. There are nearly 5.3 million cases, and 344 thousand deaths because of COVID-19 pandemic as of 05.24.2020 (World Health Organization (WHO), 2020). As a result of the pandemic, Turkey has been met with COVID-19 in March. The first case has been announced on 03.10.2020 officially, and the first death has occurred on 03.17.2020 in Turkey (Ministry of Health of Turkey (MHT), 2020). In such an environment, all economic and financial indicators have been deteriorating in the world and Turkey as well. Therefore, the COVID-19 pandemic normal should be considered in any analysis, especially related to macroeconomic and financial issues which are very sensitive risky conditions. As a leading and pioneering country among emerging countries, Turkey has also foreign investments and has been suffering from COVID-19 pandemic. Figure 1 shows the development of the main stock exchange index (i.e. XU100), cumulative cases, and deaths resulting from the COVID-19 pandemic in Turkey. As Figure 1 presents, the XU100 index has been decreasing since the beginning of 2020. Also, the index has been relatively high in the pre-pandemic and low in the pandemic period which started on 03.10.2020 in Turkey with the detection of the first case. Numbers of total cases have reached 146.5 thousand and the numbers of total deaths are around 4 thousand as of 05.15.2020 in Turkey.
With the occurrence and spreading of COVID-19 pandemic, Turkey has begun to take fiscal, monetary, and administrative precautions to decrease the negative effects on the economy, the state, corporations, households, and individuals. Some of the measures taken could be summarized as local lockdowns, quarantines on residential areas, closure of schools, ban on flights, lowering the minimum payment requirements of credit cards, cash transfers to families in need, increasing the amount of funding markets by CBRT including buying governmental bonds, deferred credit payments to banks, deferred tax and social security premium payments in various sectors, minimum wage subsidies, and ban on short sell in Borsa İstanbul (BIST) equity market as well (Morgan Stanley, 2020;Official Gazette, 2020).
First stock exchange in Turkey was established in 1985 under the name of Istanbul Stock Exchange (ISE). In 2013, BIST was established with the merger of ISE, Istanbul Gold Exchange and Futures and Options Exchanges (BIST, 2020a). With the effects of merger, BIST has been developing. For example, market value has reached TL 1233 billion as of 2020 June end whereas it was TL 505.9 billion as of 2013 end which multiplies 2.4 times. Also, total traded value has reached TL 2336.8 billion as of June end in 2020 whereas it was TL 816.8 billion in 2013. Besides, average traded value has become TL 18.8 billion as of June end in 2020 whereas it was TL 3.3 billion in 2013 (BIST, 2020b). In addition, an increasing traded volume since 2020 May has been seen in BIST equity market. Moreover, there are a variety of indices in BIST. However, BIST 100 is the main index symbolized as XU100 (BIST, 2020b).
By taking into consideration all information above, Turkey has been in the COVID-19 pandemic condition, there have been cases and deaths resulting from the COVID-19 pandemic, and the main stock index has been decreasing and it has been in low-level. Low-level index causes the underpricing of Turkish assets and this condition is negative for the country. Therefore, it would be beneficial to examine which factors cause the change of main stock exchange index in the COVID-19 pandemic period and whether these factors vary according to period whether Turkey is in either pre-pandemic period or pandemic period. Such a determination would contribute to regulatory bodies to develop policies to prevent the negative effects and hence stimulate foreign portfolio investments to Turkey via equities. Hence, Turkey can provide much more foreign portfolio inflows.
The study aims to define the effective factors causing changes in the main stock exchange index in Turkey in the pre-pandemic period and pandemic period by applying by performing random forest and support vector machine algorithms. Daily data between 01.02.2020 and 05.15.2020, 14 variables (including global, country-level, and market indicators), and the presence of COVID-19 are used for this aim. The study focuses on examining Turkey because the main stock exchange index has decreased at an important amount on average since the beginning of 2020. The study defines that the most influential factors are the retention amount of foreign investors in the equity market and CDS spreads in the pre-pandemic period. On the other hand, MSCI emerging markets index and volatility index has the highest significance in terms of change on XU100 index. Moreover, the net buying amount of foreign investors in the equity market does not affect throughout the periods examined whereas all other 13 variables have effects. The results of the analysis show the crucial effect of the COVID-19 pandemic for the changing of Turkey's main stock exchange index.
The main contributions of the study are that the study (i) is one of the pioneer study in Turkey examining the effects of COVID-19 pandemic on main stock exchange index, which is an important issue in finance and capital markets; (ii) performs random forest and support vector machine algorithms that have been only a limited number of studies about this subject in the literature; (iii) examines the determinants of XU100 index by using a large of indicators including global, country-level, market, and COVID-19 presence as well; (iv) considers daily data from 01.02.2020 to 05.15.2020 which covers the pre-pandemic period and pandemic period in the same study.
The remain sections of the study are organized as follows. Section 2 summarizes variables that are used in the analysis, provides data descriptions, and explains the theoretical background of random forest and support vector machine algorithms performed in the study. Section 3 shows the analysis results. Section 4 presents findings-based discussion and conclusion.

Variables and data
In the literature, different variables affect stock exchange indices. They could be mainly categorized under 3 groups, which are global-level, country-level, and market variables.
The first group of studies focuses on the relationship with global variables. MSCI emerging markets index, oil prices, and the volatility index (VIX) take place in this group. A variety of studies take into consideration equity market prices and equity indices. Cremers et al. (2008), and Zhang et al. (2009), andYang et al. (2018) include these variables in their studies. For example, Yang et al. (2018) use the MSCI index as a determinant. Hence, MSCI emerging market index is expected to be effective on the XU100 index since Turkey is an emerging country, and the MSCI emerging market index would be an important indicator for Turkey. When the MSCI index increases, then interest to Turkey also increases, and a positive relationship is expected between the XU100 index and MSCI index in turn. On the other hand, Turkey is expected to be negatively affected by oil prices Demir (2019) since Turkey is an oil importer country. Similarly, VIX index would make a negative effect on main stock exchange indices because the fear on capital markets also increases, and fund outflows from emerging countries increase when VIX index increases (Liew et al., 2018). For this reason, a negative relationship is expected between the XU100 index and the VIX index.
The second group of studies focuses on the relationship with country-level variables. In this group, there are CDS spreads, net funding amount of CBRT, securities amount held by CBRT, Treasury bond interest rates, Turkish Lira (TL) reference interest rate (TLREF), and USD/TL FER variables. Alexander & Kaeck (2008), Cremers et al. (2008), Zhang et al. (2009), Galil et al. (2014, Lahiani et al. (2016), Shahzad et al. (2017), and Kartal (2020) examine the relationship between equity indices and CDS spreads and determine a significant relationship. By considering these studies, a negative relationship is expected between the XU100 index and CDS spreads of Turkey. Clark & Berko (1997), Hajilee & Al Nasser (2014), Naik & Padhi (2014), Demir (2019), and Erdoğan et al. (2019a) include FER, Treasury bill, and short-term interest rate as independent variables in their study and define the negative relationship between stock index and these variables. Following this study, Treasury bond interest rates, TLREF, and USD/TL FER are included as a dependent variable to examine the XU100 index and a negative relationship is expected between the XU100 index and these variables as well. Besides, CBRT has been expanding its financial activities to support the economy in COVID-19 age. Therefore, we think that the main indicators of CBRT would be influential on the XU100 index. While Erdoğan et al. (2019b) use reel money supply as a variable, we consider two main indicators which are net funding amount of CBRT and securities amount held by CBRT in the context of main CBRT indicators. In case of increasing net funding amount and securities amount held by CBRT, there could be stability in the financial system and the increasing demand for equities. Hence, we expect a positive relationship between XU100 and these variables.
The third group of studies focuses on the relationship with market variables. This group includes equity market traded value, foreign investors' share in traded value, foreign investors' share in retention, retention amount of foreign investors in the equity market, and net buying amount of foreign investors. In literature, there are some studies that focus on the effects of foreign investors and foreign portfolio investments on equity markets and equity indices. For example, Bekaert & Harvey (1995, Clark and Berko (1997), Kim & Singal (2000), Choe et al. (1999), Kim & Wei (2002), McLean & Shrestha (2002), Tabak (2003), Adabag & Ornelas (2004), Dahlquist & Robertsson (2004), Nam (2004), Baklacı (2007Baklacı ( , 2008, Akar (2008) (2019) and Topaloğlu et al. (2019) examine various phenomena related with foreign direct inflows, foreign portfolio inflows, foreign investors, foreign trading, and net buying amount of foreign investors in, especially emerging economies. They determine that some of the foreign trading phenomena are beneficial while others are not; foreign investors decrease the volatility in the long-run and make the equity market more efficient; the equity market index increases when foreign inflows increase. By considering these studies, it is expected that different indicators of foreign investors' activities could be influential on XU100. In this context, four different indicators, which are foreign investors' share in traded value, foreign investors' share in retention, retention amount of foreign investors in the equity market, and net buying amount of foreign investors, are taken into account in the analysis as dependent variables. Also, equity market traded value is added as a variable (Gümüş, 2010;Lee & Chung, 2018;Naufa et al., 2019) because the XU100 index is calculated based on equities which are traded in the equity market. For this reason, equity market traded value would be important. By the studies in the literature, a positive relationship is expected between the XU100 index and these variables. Positive (+) relationship means that XU100 increases when independent variables increase.
Negative (−) relationship means that XU100 decreases when independent variables increase.
In addition to these variables taking place in 3 groups, we consider the presence of COVID-19 pandemic in the analysis because the pandemic is a breaking point for all developed and emerging countries and Turkey as well.
On the other hand, this study includes the period between 01.02.2020 and 05.15.2020. This period is selected to focus on the very recent period including in time of COVID-19 pandemic and the nearest times before COVID-19 in 2020. For this reason, daily data is considered in the study. Data for only weekdays is considered because data for some variables like XU100, USD/TL FER, and net buying amount of foreign investors etc. could not be obtained for weekends. Therefore, weekend and official holidays are excluded from the analysis. Data for all variables are gathered from Bloomberg Terminal, CBRT (2020), MHT (2020), and Central Securities Depositories of Turkey (CSD, 2020) via email.
As dependent variable, daily closing values of XU100 index are used by following the studies of Gümüş (2010), Elmas (2012), and Kesik et al. (2016). That is why because we focus on the changes of XU100 level rather than changes in daily return. Moreover, Table 1 summarizes the details of all variables which are included in the study.

Data acquisition and preprocessing
The daily data (workdays) between 01.02.2020 and 05.15.2020 was obtained from various sources in the study. The dataset was split into two periods, which were named as the pre-pandemic period and the pandemic period. Thus, the effects of independent factors on the XU100 index in both the pre-epidemic and the pandemic periods were able to be measured. Since the first COVID-19 case appeared on 03.10.2020 in Turkey, the pre-pandemic period represents the data between 01.02.2020 and 03.09.2020. Also, the pandemic period includes data between 03.10.2020 and 05.15.2020. The model was constructed in five different steps. The flowchart of the proposed model is detailed in Figure 2.
The methodology steps of this study are as follows: the first step of the methodology was to obtain the data used in this study from different data sources. The second step was to aggregate the datasets obtained and created one combined dataset which was ready to analyze. In the third step, the dataset was split into two groups to analyze the effects of independent variables on the XU100 index in both the pre-pandemic and the pandemic periods. Random Forest and Support Vector Machines algorithms with a cross-validation approach were used for both datasets in the fourth step. In the final step of the methodology, results obtained from the pre-pandemic and the pandemic periods were evaluated.

Model building
Nowadays, machine learning algorithms are widely used in almost every research area such as banking, finance, and economics. Random Forest and Support Vector Machines are the most common machine learning algorithms in the literature. Besides, other machine learning algorithms such as k-Nearest Neighbors, Naï ve Bayes, and Neural Networks are used for different real-life problems.
There are two major ensemble learning methods for classification or regression tree algorithms, which are boosting and bagging (Shapire et al., 1998;Breiman, 1996). In 2001, the new algorithm, which is named as Random Forest, is proposed by Breiman as an upgraded version of bagging learning (Breiman, 2001). The algorithm steps of Random Forest are as follows (Wiener & Liaw, 2002): 1. Select n sample randomly from the dataset, which is named as ntree. 2. For each of the samples, construct an unpruned decision tree with the following modification. In each tree, select the number of predictors randomly (mtry) and choose the best split from among those predictors. 3. Predict the target variable by aggregating the predictions of the trees.
On the other hand, Support Vector Machines is proposed firstly in 1992 for classification and regression problems (Vapnik, 1995;Vapnik et al., 1998). The Support Vector Regression uses cost function (e-intensive loss function) to minimize regression error. The optimization problem is defined as in Equation 1 (Law & Shawe-Taylor, 2017 (1) subject: The first term of the objective function represents the regularization constraint to prevent over-fitting and the second term is the ε-insensitive loss function. + , − represents the slack variables in the optimization problem.

Model testing and cross-validation
One of the most important parts of a machine learning approach is to set a training dataset, where the model is enhanced, and testing datasets, where the model results are tested, to prevent overfitting/underfitting problems. In a machine learning algorithm, there are no strict assumptions such as stationarity, correlation, and cointegration between variables. This is the strongest aspect of the machine learning approach. In this study, a k-fold with t-repeat cross-validation approach was performed to avoid overfitting/underfitting problems. With this approach, the dataset was randomly separated into k equal sized subsamples. k-1 sub-samples were used as training datasets while one sub-sample was used as a testing dataset. The k estimations were used to produce a single estimation (Hastie et al., 1996). This process was repeated t times to obtain robust results. In this study, 5-fold with a 5-repeat cross-validation approach was applied to avoid overfitting/underfitting problems in the model. Table 2 presents the descriptive statistics for determinants which is important to understand the basic characteristics of the dataset. In Table 2, the XU100 index was 117,362 on average in the pre-pandemic period but it decreased to 94,743 level in the pandemic period. MSCI emerging country index, oil prices, Treasury bond interest rates, TL reference interest rate, equity market traded value, foreign investors' share in traded value, amount of foreign investors in the equity market, foreign investors' share in retention, and foreign investors' net buying amount decreased in the pandemic period compared to the pre-pandemic period. On the other hand, the Volatility index, CDS, USD/TL foreign exchange rate, CBRT net funding amount, and CBRT security amount increased in the epidemic period compared to the pre-epidemic period. An independent sample t-test was performed for each factor to measure whether the gap between the pre-pandemic and the pandemic periods has changed significantly. It was revealed that the average values of all factors in the pandemic period have significantly changed based on the pre-pandemic period, except for the net buying amount.

Comparing the performance of machine learning algorithms
The goodness of fit criteria such as R 2 , Root Mean Square Error (RMSE), and Mean Absolute Error (MAE) was evaluated to choose the best performing model among the models that have a continuous dependent variable. These statistics are given in Table 3 for both Random Forest and Support Vector Machines algorithms. Based on Table 3, although the R 2 values of both algorithms are quite high, the Support Vector Machines algorithm has a higher R 2 and lower RMSE and MAE values than the Random Forest algorithm in both periods. Thus, it was decided that Support Vector Machines algorithm details are interpreted.

Analysis results
The term variable importance analysis is used to measure the effect size of the independent variables on the dependent variable. Variable importance for Support Vector Machines algorithms is given in Figure 3.
In the pre-pandemic period, the top 3 factors affecting the XU100 index were determined as retention amount of foreign investors in the equity market (FAMOUNT), CDS spreads, and Treasury bond interest rate (DIBS). Since the COVID-19 pandemic affected all sectors such as health, finance, production, and education, the priorities in these sectors and the importance of all factors that sustain these sectors have been changed. Thus, as expected, the top 3 factors affecting the XU100 index in the pandemic period have changed as MSCI emerging market index (MXEF), VIX index, and retention amount of foreign investors in the equity market (FAMOUNT). The importance of CDS spreads decreased from 2 in the pre-pandemic period to 12 in the pandemic period. On the other hand, the importance of MSCI emerging market index and CBRT Securities Amount (CBRT_SEC) increased to 1 and 4 from 4 and 11, respectively. The actual and predicted values of the XU100 index predicted from the Support Vector Machines algorithm are given in Figure 4.
The actual and predicted values obtained from the support vector machines algorithm of the XU100 were very close real values of the XU100 index in both periods. Furthermore, the model was able to predict sudden increases or decreases very well.

Discussion and conclusion
In the study, the determinants of the main stock exchange index (XU100) changes in Turkey in the COVID-19 pandemic age were analyzed. In this context, daily data between 01.02.2020 and 05.15.2020, which includes pre-pandemic and pandemic periods, was used. Also, 14 variables were defined to be used in the analysis by reviewing the present literature. These variables could be classified under 3 groups as global-level, country-level, and market-level. The global group includes 3 variables, the country-level group includes 6 variables while the market-level group includes 5 variables. After collecting data from various data sources and splitting all data into two sub-period as pre-pandemic period and pandemic period, the performance of machine learning algorithms was compared and it was defined that the Support Vector Machine algorithm had higher prediction accuracy concerning Random Forest algorithms in both pre-pandemic and pandemic period. Therefore, the results of the Support Vector Machine algorithm were used.
As a result of the Support Vector Machine algorithm, amount of foreign investors in the equity market, CDS spreads, government bonds interest rates, MSCI emerging markets index, and volatility index were determined as the most important variables on XU100 index in the pre-pandemic period. On the other hand, in pandemic-period, MSCI emerging markets index, the volatility index, retention amount of foreign investors in the equity market, amount of security hold by CBRT, and equity market traded value were the most important factors, respectively.
The results obtained in the study were similar to the other studies in the literature except for only one market variable which is the net buying amount of foreign investors. Although various researchers like Bekaert & Harvey (1995), Clark and Berko (1997), Choe et al. (1999), Tabak (2003), Dahlquist & Robertsson (2004), Akar (2008), Gümüş (2010), İskenderoğlu & Karadeniz (2011), Sevil et al. (2012, Vo (2015), Kesik et al. (2016), and Topaloğlu et al. (2019) defined that foreign investors' activities were important on stock exchange indices, we had interestingly reached opposite results for net buying amount of foreign investors variable in the study. In other words, the net buying amount of foreign investors did not affect the XU100 index in both pre-pandemic and pandemic periods.
The findings of the study mainly concluded that the effects and importance order of influential variables on the XU100 index varies according to the period whether Turkey is in the pre-pandemic or pandemic period. By considering this determination, the presence of COVID-19 currently and the results of the study, Turkey should focus on influential factors that are effective on the XU100 in the pandemic period. Therefore, Turkey should give priority to the most important variables firstly, and could deal with other factors after that. In this context, the main focus priorities of Turkey are the MSCI emerging markets index, volatility index, retention amount of foreign investors in the equity market, amount of security hold by CBRT, equity market traded value, USD/TL foreign exchange rates. Because MSCI emerging markets index and volatility index is global factors, they are not fully control of Turkey. For this reason, Turkey could give priority to decrease the negative effects of the amount of security hold by CBRT, equity market traded value, USD/TL foreign exchange rates variables on XU100 and stimulate the increase of retention amount of foreign investors in the equity market. Hence, Turkey could provide some earnings in supporting the increase of XU100 in total. After that, Turkey could focus on other factors in turn. In total, every precaution related to the decreasing country risk could be beneficial in providing a positive contribution to the variables used in the study and to XU100 in turn. Taking measures by considering the results of the study could help prevent the effects of the decrease of the influential variables on the XU100 index. By doing so negative effects could be prevented and assets traded in BIST could be priced at their fair value.
The results of the study emphasized the importance of the COVID-19 pandemic on the XU100 index that which factors are influential on XU100 index and importance of variables in terms of the significance vary according to period whether Turkey is in COVID-19 pandemic or not. Therefore, the most significant implication of analysis results for beneficiaries (especially for equity traders and investors) is that they should consider the development of COVID-19 in Turkey (i.e. probable second and third waves), and should allocate their portfolio assets among possible instruments by considering the effect of the pandemic on these alternatives. By considering that the effects of COVID-19 may change on alternatives, they should always follow up the development in financial markets as well. For example, MSCI announced that they will remove Turkey from MSCI emerging market index because of short sell ban in equity market. Therefore, equity traders should always consider such announcement in their decision-making process. Only after a while, Turkey has removed short sell ban from BIST 30 equities which are the most liquid indices in BIST. Also, this development should also be considered. As a summary, new announcements and developments may occur in every time and these may be either a positive or a negative leading indicator for main stock exchange indices as can be understood from this example. Equity traders and investors (individual & corporate) can re-arrange their portfolios by considering the analysis of the study. In this study, we focus on Turkey since the main stock exchange index of Turkey has decreased at a significant amount. Turkey could increase foreign portfolio investment inflows via equities. On the other hand, focusing on Turkey is the main limitation of the study. Also, focusing on macro-level factors is another limitation of the study. In future studies, other important indices in BIST like XU030 and XBANK could be examined and market-based examination could be performed. Moreover, the different bundle of developed and emerging countries like China (COVID-19 originated country), Hong Kong, India, Italy, Greece, Spain, Philippines, Brazil, South Africa which have an important amount of decreases in their national main stock exchanges in COVID-19 pandemic times could be examined in future studies for the extending literature. Moreover, new variables could be included in the analysis and new statistical or econometric methods could be applied in the forthcoming studies.