{'fraction_non_alphanumeric': 0.035031421313009764, 'fraction_numerical': 0.022819450015599232, 'mean_word_length': 4.797932816537467, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Are CDS spreads predictable during the Covid-19 pandemic? Forecasting based on SVM, GMDH, LSTM and Markov switching autoregression

This paper investigates the forecasting performance for credit default swap (CDS) spreads by Support Vector Machines (SVM), Group Method of Data Handling (GMDH), Long Short-Term Memory (LSTM) and Markov switching autoregression (MSA) for daily CDS spreads of the 513 leading US companies, in the period 2009–2020. The goal of this study is to test the forecasting performance of these methods before and during the Covid-19 pandemic and to check whether there are changes in the market efficiency. MSA outperforms all other methods most frequently. GMDH breaks the efficient market hypothesis more frequently (75%) than other methods. The change of the relative predictability during Covid-19 is small with some increase of the advantage of the investigated methods over a benchmark. We find that the market has been less efficient during Covid-19, however, there are no huge differences in prediction performances before and during the Covid-19 period.


Introduction
Forecasting financial time series aims to anticipate predictable patterns that will bring investors advantage in trading opportunities. In financial theory, this issue is explained by the efficient market theory defined by Fama (1955Fama ( , 1970, Jensen (1978) and later extended by Malkiel (1992). However, the efficient market theory refers to "real time" opportunities and stable forecasting patterns will become redundant after their discovery by a large number of players (Timmermann and Granger, 2004). According to Timmermann and Granger (2004), testing events with the efficient market theory has significance (and growing popularity) for non-stationarity in financial time series. The forecasting of systematic patterns is mostly related to predicting the prices of various assets, however, only a few studies forecast credit default swaps (CDS). Such forecasting, which has a non-stationary nature, is very difficult (Henrique et al., 2019;Zhang et al., 2017), because it is chaotic, dynamic, and nonlinear.
Forecasting the patterns of CDS also aims to break market efficiency caused by a certain process or event. A number of researchers believe that certain events or processes in the future may impair unbiased market efficiency (Lee et al., 2020), with positive (negative) deviations affecting large positive (negative) excess returns (Abe and Nakayama, 2018) or a change in spreads caused by economic shocks (Gilchrist et al., 2016). From March 2020, the financial markets have had a new shock, caused by the global Covid-19 pandemic. This huge shock and its transmission mechanism may break market efficiency and/or existing patterns in markets. Considering that the SVM, GMDH, LSTM and MSA methods show the best performance in CDS spread forecasting (see discussion in section 2), the goal of this study is to discover outperforming methods before and during a crisis event . To test this, we analyze CDS spread time series data of the leading 513 US companies from 2009 to 2020. Our study contributes to existing literature to get a better understanding of CDS spread forecasting and practically as an important tool for investment decision making. The novelty of the study lies in the fact that this is the first study of forecasting CDS spreads by testing these 4 methods, especially comparing MSA to the other three methods based on kernel or artificial intelligence and testing their predictive power before and during the Covid-19 pandemic. It is aimed to encourage future research in this area, especially given the financial crisis associated with credit derivatives and recent uncertainty in financial markets caused by the Covid-19 pandemic. Given the popularity of these methods, in this study we aim to answer the following: Do these methods have satisfactory performance in CDS spread forecasting? Do they outperform the random walk, which is impossible for efficient markets (possible brakes in efficient market theory)? Does the Covid-19 (as a process or event) affect the performance of these methods?

Related work
Numerous studies have tested different prediction models for time series data during Covid-19. Katris (2021) used classical (Exponential Smoothing and ARIMA) and the machine learning (Feed-Forward Artificial Neural Networks and Multivariate Adaptive Regression Splines) models for time series Covid-19 outbreak forecasting in Greece. He forecast with the Newbolt/Granger grouping scheme of models, to build a log-normal distribution of the downward trend of the outbreak. Gaglione et al. (2020) forecast time series of the Covid-19 outbreak in Italy, with the Bayesian sequential estimation and forecasting algorithm. They found that the Bayesian framework outperforms curve-fitting approaches. Pereira et al. (2020) used LSTM with modified Auto-Encoder networks to predict the Covid-19 outbreak in Brazil. According to their results, this method performs better than single LSTM. On the other hand, Chimmula and Zhang (2020) found that the LSTM network provides satisfactory performance in forecasting time series data during the Covid-19 pandemic. The authors develop a deep-learning model to forecast the Covid-19 outbreak in Canada. Peng and Nagata (2020) used SVM to forecast Covid-19 time series data in the 12 most-affected countries. They found that SVM with a kernel function shows the best performance in nonlinear out-of-sample forecasts.
In addition to studies that forecast the Covid-19 pandemic, several studies have focused on financial time series data during the Covid-19 pandemic. Given that Covid-19 is an event that affects players who fail to form rational expectations or fail to adjust their trading strategy given their expectations, the Covid-19 event has become an attractive topic in financial forecasting. For example, Ghosh & Chaudhuri (2021) applied kernel principal component analysis to refine several technical and macroeconomic indicators for separate forecasting by stacking and deep neural network models. They found that both models perform well before and during the Covid-19 pandemic. Colladon et al. (2020) used a textual data index to forecast return and volatility dynamics of financial variables in the Italian market. According to the authors' results, this model is very accurate at forecasting bond returns and volatilities during Covid-19.
The question still arises: Which models proved to be the most accurate in forecasting financial time series, including CDS spreads? Jia et al. (2020) tested a number of forecasting models based on machine learning and deep learning techniques, or metamodels to predict future values. One of the most widely used machine learning methods in forecasting is the artificial intelligence method (ANN) based on neurons and emulates the human system of learning through pattern identification (Vyklyuk et al., 2013;Laboissiere et al., 2015;Vukovic et al., 2020). However, according to Li et al. (2020), LSTM as a deep learning method, outperforms ANN in addressing the long-term dependence problem. It has become a very popular method in financial market forecasting because of the characteristics that are very efficient and predictable in occurrences, having significant deterrent qualities. Lee et al. (2021) claim that models based on deep learning have greater forecasting power than regression or time series models, that use conventional statistical methods. The same authors find that LSTM is a feasible option for predicting trends of commercial vacancy in commercial districts.  argue that accuracy and performance power of LSTM are influenced of parameters and optimization. To increase the accuracy and power of LSTM model prediction, these authors use fruit fly optimization algorithm.
Another popular method in financial time series forecasting is the kernel-based SVM method. The main difference between artificial intelligence methods and SVM is in the fact that the first one minimizes the errors in the training stage, while SVM minimizes the upper threshold of the error of its classification (Henrique et al., 2019). SVM is a very popular method in time series prediction due to its superior learning ability (Zhou et al., 2016). Tobback et al. (2018) tested CDS spreads as part of ten different variables by using 210,000 articles for text mining and applying support vector machines (SVM) with a linear kernel, modality annotation and constructing an Economic Policy Uncertainty index for Belgium. They found that the SVM method has higher predictive power. The next most used method is Group Method of Data Handling (GMDH), developed by Ivakhnenko (1988). Even though this model is old and has been used over the last thirty years, many authors use GMDH because it is particularly suitable for the cases when little data are available (and no a priori information is available) on the structure of the mechanism generating the series. According to Yang et al. (2009), GMDH is a more efficient model for prediction compared to artificial intelligence methods and statistical models for a given level of data. Finally, the MSA model, as an effective predictive technique, is used in many studies. MSA has become a very popular model due to its features capturing the schematic behavior of financial return series, fat tails, continually arising periods of instability with low volatility, skewness, and time-varying correlations (Ang & Timmerman, 2012;Stutzer, 2020).
In addition to previous studies, the motivation of our research is also supported by the next several studies (concerning CDS spread forecasting) 11  2. Kim et al. (2020) analyzed and forecast time-series (2008-2019) of term structure of CDS spreads by using the Nelson-Siegel model, recurrent neural network, support vector regression (SVR), LSTM, and GMDH. They authors found that RNN, SVR, LSTM and GMDH outperform the Nelson-Siegel model, while GMDH was the most accurate in the prediction.
3. Fei et al. (2017) found a time-varying dependence between CDS spreads and equity prices. The authors empirically proved that the MSA bivariate copula model is an appropriate measure of forecasting (in crisis dependence and low dependence for in-sample statistical criteria).
4. Avino and Nneji (2014) forecast CDS spreads using linear and nonlinear models, studying the iTraxx Europe index during the 2008 financial crisis. They noted that the Markov switching models underperform other linear models.

Support vector Machines
SVM can be viewed as a supervised learning approach for data analysis. The idea behind SVM is to find a hyperplane that maximizes the distance between classes. SVM for a regression can be expressed as the following optimization task (1).
where x i ∈ R p ,i = 1,2,...,n, and y ∈ R n , y i is the true outcome for x i input and ŷ i = w T ϕ(x i ) +b we can refer to as predicted outcome for x i input. ζ i is the penalty if the difference between the prediction w T ϕ(x i ) +b and the target y i is greater than the allowed distance ∊. ϕ(⋅) is a function that is applied when a linear separation of observations is not possible. In addition, it is common to use the radial basis function in SVM for time series analysis (Liu et al., 2011).

Group method of data handling
The group method of data handling is an inductive self-organizing method for solving data analysis tasks. A function for GMDH can be generally viewed as a combination of elementary functions (f i ) and coefficients (2). However, GMDH is usually based on polynomial reference function such as Kolmogorov-Gabor polynomial (3). Different reference functions can be also used, e.g. harmonic and logistic (Xu et al., 2021).

Long Short-Term Memory
Long Short-Term Memory is a type of Recurrent Neural Network in which short-term and long-term items are stored and applied effectively. LSTM models are often applied in time series analysis. Within LSTM networks, cells form units, and units form layers. Each cell has input, output, and forget gate. Equations (4)-(8) "show the form of the forward pass of the LSTM unit (x t : input vector to the LSTM unit, f t : forget gate's activation vector, i t : input gate's activation vector, o t : output gate's activation vector, h t : output vector of the LSTM unit, c t : cell state vector, δ q : sigmoid function, δ c , δ h : hyperbolic tangent function, *: element-wise (Hadamard) product, W, U: weight matrices to be learned, b: bias vector parameters to be learned)" (Sezer et al., 2020).

Markov switching autoregression model
Markov switching autoregression can be viewed as a set of autoregressions connected with regime specific values, i.e. the number of autoregressions is equal to the number of regimes. For example, let s t denote an unobservable state variable assuming the value one or zero. A simple switching model for the variable z t involves two AR specifications (9): where |β| < 1 and ∊ t are i.i.d. random variables with mean zero and variance σ 2 ∊ . This is a stationary AR(1) process with mean α0 1− β when s t = 0, and it switches to another stationary AR(1) process with mean α0+α1 1− β when s t changes from 0 to 1 (Kuan, 2002).

Results
In this section, SVM, GMDH, LSTM and MSA models are employed to analyze forecasting performance for CDS spreads before and during the Covid-19 pandemic, and to check whether efficiency of market changes due to Covid-19.

Data description
The dataset that is analyzed in this study consists of time series obtained from Bloomberg terminal. The time horizon for the training and testing is from 28 October 2009 to 16 October 2020, 2799 observations in total. We observed daily CDS spreads (1-year, 4-year, 7-year, and 10year) for 513 US all ratings (investment and high yields, debt typesenior) companies from multiple sectors. Fig. 1 shows the times series plots of CDS spread average levels for all maturities. The dataset is created similarly like in the following studies: Avino and Nneji (2014), Kim et al. (2020), and Buse and Schienle (2019).
It can be seen on Fig. 1 that Covid-19 is not the most volatile period for CDS, and training set includes very different dynamic of CDS. The parameters of the models are estimated on training set only. The performance is computed on tests sets. It is very restrictive (tight) form of out-of-sample forecasting tests. Moreover, we use default values of the model's hyper-parameters (such as layers number for LSTM). It prevents any possibility of out-of-sample data influence on choice of the hyperparameters (for example via criteria choice). However, it creates disadvantages for more flexible approaches due to missed possibility of their improvement (for example, LSTM can be greatly improved according to , Lee et al. (2021).
The Fig. 2 describes how we combine data and used methods/ models. Training set starts from 28 October 2009 till 6 December 2018. Three test sets of the same size (158 observations) were formed in order to show how the above-mentioned methods will perform during Covid-19 pandemic period in comparison to periods before the pandemic. The World Health Organization declared pandemic due to coronavirus on 11th March 2020. The first test set starts from 7 December 2018 till 19 July 2019, the second one from 22 July 2019 till 9 March 2020, and the third one from 11 March 2020 till 16 October 2020.
The following software were used for handling calculations: • Sklearn python package was used for SVM. More specifically, SVR method was used from this package with radial basis function as a kernel and gamma = 0.1. • Gmdh.py python package was used for GMDH. More specifically, multilayer GMDH method was used from this package. • Tensorflow python package with Keras API was used for LSTM. LSTM had 100 epochs. RobustScaler method were used from sklearn package for scaling the data. • Eviews 11 was used for building MSA. AR (10) model with 2 states (namely 'normal' and 'crisis' states or regimes (Fei et al., 2017)) was taken as the basis for CDS forecasting. x t is predicted by the first equation if economy is in 'normal' state (s t = 0) and by the second equation if economy is in 'crisis' state (s t = 1) (13).

Performance
LSTM, SVM and GMDH produce point forecasts, and we use the main measures to estimate the efficiency of such forecasts: root mean square deviation (10), mean absolute error (11), mean absolute percentage error (12). Random walk is used as a benchmark. If an error measure is lower for a forecast than for the benchmark, then this forecast is effective, and such an instance is marked with an asterisk (Table 2).
The results show the consistency of the methods. If a method outperforms the benchmark during the normal periods (test set 1, test set 2),  they most likely outperform the benchmark during the Covid-19 period (test set 3). There are only 2 notable exceptions for the opposite sentence: MSA for 7Y and LSTM for 4Y lose during normal times but win during Covid-19. The forecasting errors are larger in the Covid-19 period (test set 3) but relative performance is generally sustained. Moreover, the share of cases outperforming random walk is growing slightly during Covid-19. It means that the market became less efficient during extraordinary periods (Fig. 3). The forecasting techniques give better predictions of CDS spreads for longer maturities in the Covid-19 period (see Table 1). GMDH is the most stable in terms of outperforming random walk (75% of cases). MSA outperforms all other methods more frequently than the others (16 cases for MSA and 13 for GMDH). Fig. 3 reports lower market efficiency (possible breaks) for all four CDS spreads from March 2020. This situation recognizes the possibility to predict systematic patterns, which gives the investor the opportunity to gain extra returns (in line with studies of: Hu et al., 2019;Kim et al., 2020). Moreover, forecasts are more accurate for the longer term CDS spreads (according to Table 2). This situation can be explained by the fact that during a crisis, the demand and volatility of short-term instruments increases. Considering this, the accuracy of forecasting financial market instruments also depends on their maturities, which many studies do not take into account (they usually analyze one or more instruments with the same maturity). Lastly, test sets 1,2 and 3 (Table 2) reports similar accuracy in forecasting, which indicates that predictions during Covid-19 do not affect higher forecasting performance (they are similar and satisfactory for pre and during Covid-19 period; this is in line with study of Ghosh & Chaudhuri, 2021).

Discussion
Our results are in accordance with Kim et al. (2020) where GMDH outperforms SVM and LSTM. However, these authors did not test MSA, which has previously been shown to have better performance compared to SVM and LSTM in similar time-series data (Fei et al., 2017). From a risk management perspective, our results support Ardia et al. (2018), showing that MSA is a good method for forecasting financial time series. In the case of Covid-19, we also show the possibilities of time series data forecasting, indicating breaks, which is line of studies of Gaglione et al. (2020) and Katris (2021). However, our results show better forecasting performance of longer period data (seven and ten years CDS) compared to study of Gaglione et al. (2020) (where the authors find better performance for a shorter time interval). We can also conclude that our results are in line with LSTM's satisfactory performance in the findings of Chimmula and Zhang (2020) and Peng and Nagata (2020) for SVM performance. Lastly, our findings are most similar to results of Ghosh & Chaudhuri (2021), where methods show satisfactory prediction Table 1 Related work and the contribution of the study. In the period of increased volatility and potential structural breaks, forecasting accuracy appears to be driven by the company's nonlinear specific credit risk. We find that the market has become less efficient during the Covid-19 pandemic, which gives the investor the opportunity to forecast systematic patterns related to CDS spreads. There are no huge differences in prediction performances before and during the Covid-19 pandemic. In both periods, our tested methods show the possibility of predicting systematic patterns, where breaks in market efficiency are just slightly higher during the Covid-19 pandemic. In other words, the historic CDS data from the pre Covid-19 period can be used for training methods that are supposed to be used in the post Covid-19 period, which can be a significant practical value for investors.
Our tests are based on single variable approaches for aggregate measures with unfavorable restrictions for sophisticated forecasting methods. It opens many suggestions for future studies. It can be checked whether the predictability properties are uniformly distributed across sectors or our results are forced by properties of a few sectors. It can be checked whether the cross-dependence of different CDS has changed due to the Covid-19 pandemic that can lead to lower market efficiency. The comparison of methods producing density (instead of point) forecasts can be investigated. The analysis of forecasting error distribution, including the changing of its volatility and statistical hypothesis testing can be another direction of future studies. Finally, future studies could optimize related parameters in model to achieve higher predictive performance (like LSTM in study of ).

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. b) This paper has been supported by the RUDN University Strategic Academic Leadership Program (for authors from RUDN). c) Support from the Basic Research Program of the National Research University Higher School of Economics is gratefully acknowledged by Kirill Romanyuk.

Funding
The manuscript has supported by Russian Science Foundation for the project No. 22-28-01553 (Making Smart Decisions in the Face of Uncertainty in Russia: Investing and Forecasting in a Crisis).

Disclaimer
This article presents the authors' personal opinion and may differ from the official position of the Bank of Russia. The Bank of Russia assumes no responsibility for the content of the article.