Presentation and Testing of the Creeping Trend with Harmonic Weights Method in the Light of Sovereign CDS Prices

The prediction of financial indicators is not easy, as the influencing factors may change from time to time. The sovereign credit default swap (CDS) spread is a complex measure which helps evaluate country risk, and there are a number of quantitative and qualitative criteria that may have an impact on the price development. The study aims to present and test a relatively new method. Forecasting based on the creeping trend with harmonic weights allows us to manage independent variables that are not constant in time. The study presents the method and illustrates its effectiveness through an empirical example, using the Hungarian and German five-year USD denominated quarterly CDS spreads.


INTRODUCTION
Economic developments and their expected future tendencies have an important role in the decision-making process. The analysts try to analyse the time series data and based on their results they attempt to determine the trends. For this they can use several different methods and techniques. Precise forecasting in the credit derivatives market is just as important as in the case of any other economic process.
One of the most common credit derivatives is the Credit Default Swap (CDS). There are several types, applicable to companies and countries (the latter is called as sovereign CDS premium). CDS is essentially an agreement between two parties to exchange a third party's credit risk with a given interest rate over a given maturity. In practice, this works like insurance. The purchaser of CDS pays the seller a fee (spread) at a certain time, and in exchange for certain default events the seller takes the risks. Interest spread is determined in base points. The fee actually is the product of the interest margin in base points and the total nominal value of the insured asset. Interest spreads are usually paid quarterly (Varga 2008).
However, the CDS does not only have insurance functions; in many cases trades are carried out for speculative purposes. As the CDS is traded on OTC (overthe-counter, non-regulated) markets, it also offers anonymous transactions. The value of sovereign CDS is an important variable for a country because it affects external sources of funding. In addition, it is linked to many macroeconomic, financial, and political variables that make the sovereign CDS a good choice to test different forecasting models.
In time series analysis we can choose from several forecasting methods. The purpose of this paper is not to explore the processes behind the movement of sovereign CDS spreads, but to test a lesser known but effective forecasting method. The method of creeping trend with harmonic weights (Szilágyi et al. 2016) is suitable for the short-term forecasting of complex processes.
In addition to the introduction of the theoretical background, an empirical study was also performed. In the analysis the Hungarian and German five-year USD denominated CDS spreads were estimated using various macroeconomic and financial indicators. Quarterly data was used, enabling a sufficient number of samples to be available despite the relatively short time periods (2012-2016 and 2003-2016).
The study is structured as follows: in the second section the sovereign CDS-related literature is introduced. The third section presents method selected, the creeping trend with harmonic weights. The fourth section contains the empirical analysis. Finally, the fifth section provides the conclusions and a summary.

POSSIBLE CDS FORECASTING METHODS -LITERATURE REVIEW
In the last decades, different derivatives have gained popularity. Credit Default Swap (CDS) products are among the most popular group of credit derivatives. As the products are traded outside the stock exchange, the range of available information is limited, though the authorities attempted to regulate the trade more intensively by changing the rules after the 2008 crisis. Researchers are increasingly attracted by CDS price movements, so the number of publications is constantly growing. Within these, an increasing number of studies are about the examination of sovereign CDS spreads. Duffie et al. (2003) examined Russian sovereign bonds denominated in USD. They tried to quantify the effects of different events, paying particular attention to the restructuring. In the paper, a pricing model based on a likelihood estimation was developed and they found that the yields are very different in time and respond to political events, changes in oil prices and foreign reserves. Remolona et al. (2008) investigated emerging markets and measured the risk of countries using sovereign CDS spreads as indicators. The CDS spreads were divided into two parts: the expected losses from bankruptcy and the market risk premium expected by investors. It was concluded that change in the various fundamentals mainly affects the sovereign risk, while change in the risk aversion factor of investors influences the volatility.
During their analysis, Fontana and Scheicher (2010) focused on the Eurozone's sovereign CDS prices and government bonds. They used weekly data and tested ten different countries. They recognized that common factors played a major role during the financial crisis. In addition, from the beginning of the crisis the values of CDS spreads exceeded the value of bond payments, on average. One of the reasons for this could be the limited arbitrage opportunities. In addition, it was emphasized that there is a difference between countries in terms of price integration. Longstaff et al. (2011) divided the sovereign risks by analysing CDS spreads. Two main components were developed: global and local economic factors. Perhaps surprisingly, they concluded that sovereign country risk is affected by global factors (in particular, various economic indicators of the United States) more strongly than by country-specific factors. This raises the question of how sovereign the risk of each country can be if global factors play a key role. This finding can be particularly important when selecting the variables for the analysis. Dieckmann and Plank (2012) examined the evolution of CDS spreads in developed economies during the financial crisis in 2008. It was found that there is a great movement between countries and that the pre-crisis financial markets played a major role in the movement of country risk premiums. They recognized that the members of the European Union are more exposed to the risks, more vulnerable than the non-member countries. Aizenman et al. (2013) focused on the role of fiscal space and economic fundamentals, using panel regression and Arellano-Bond dynamic panel estimation. Based on the pairwise comparison of different countries, they concluded that systematic estimation errors occurred in the sovereign CDS markets during the 2008-10 financial crisis.
According to the literature, in the analysis of CDS spreads it is certainly worth taking into account macroeconomic and financial indicators. In addition, where possible, exploration of relations between countries is also needed. However, there are many factors that are difficult to quantify and model. For example, the impact of policy changes, the role of declarations, developments in credit ratings, etc. Integration of these variables into the model poses a serious challenge to researchers.

CREEPING TREND WITH HARMONIC WEIGHTS
In the literature one can read about many predictive methods, some of which are simple techniques and others more complicated. The applicability of the methods depends on several factors, e.g. time period of forecasting, the quantity and quality of available data, the time, the budget, etc. (Szilágyi et al. 2016) In many cases, the observed process or phenomena are influenced by different factors over time, so traditional models with the same variables cannot properly describe the changes. Recognizing these changes and the breakpoints is always a challenge for researchers. There are several possible approaches which can be used for find the breakpoints, such as ARMA models, Bayesian statistics, Markov chain (Pesaran et al. 2006), or CUSUM (cumulative sum) models or likelihood approaches (Aue & Horváth 2012). Since the primary purpose of the study is to present the creeping trend with harmonic weights method, the identification of breakpoints is not included. Szilágyi et al. (2016) have developed a technique that combines the method of harmonic partial trends (Besenyei & Domán 2010;Hegedűsné Baranyai 2007) with multivariate regression analysis (OLS) (Wooldridge, 2016). This can be used to validate the relatively accepted view that values closer to the present are more relevant to the future than the "older" values. In addition, it also allows the researcher to use different, truly relevant independent variables during the different periods.
The variables included in the analysis are determined on the basis of the literature. Since the effect of some phenomena may intensify or weaken from time to time, it is desirable to include the widest range of variables in the analysis. The underlying, hidden links between the variables may also cause differences in the regression functions for each period.
The inclusion of qualitative variables in the analysis may also be necessary, but it is a very difficult task. For example, political decisions and declarations have a clear impact on the perception of a country's risk. However, quantifying political declarations is not easy. One possible case for involving quality variables is the use of dummy variables. However, this has a limit, since dummy variables are binary variables and the description of a complex phenomenon is difficult and complicated. In addition, since multiple variables have to be created for multiple possible values, the reliability of the regression results is also reduced.
Indices and indicators are often used to display quality factors. However, developing a good methodology in this case is a time-consuming and complicated task. However, for a comprehensive study, it is necessary to turn the quality aspects into the analysis in somehow. The creeping trend with harmonic weights is capable of taking into account the qualitative factors, since in the regression analysis we can use dummy and other indicator variables. Later there will be qualitative variables in the model, but in this paper the regression functions contain only quantitative factors.
The steps of the creeping trend with harmonic weights are the following: 1. Determination of the subsamples (number of time periods for each regression function); 2. Creation of optimal regression functions for each subsample; 3. Estimation for each year/quarter/month/week etc. based on the regression functions; 4. Determination of weights based on the adjusted R2 values; 5. Use of the harmonic sub-trends method (Besenyei & Domán 2010) and create the forecast; 6. Interpret and validate the results.
In the first step, it is necessary to determine the number of sub-samples. These subsamples will "slip" from time to time. The structure can be seen in Figure 1.
An optimal regression function is determined for each sub-sample. For this the most common method is OLS, but other functions can also be applied, taking into account the multivariable assumptions. Based on the regression functions, for the sub-samples we have an estimated value for each moment. Since it is a "moving" calculation, in each case, except for the first and the last period, several estimates are created.
These values are weighted and averaged using the weights determined by the adjusted multiple determination coefficients. For the determination of the weights first we have to obtain every R 2 value (in the example above we can see 9 different time periods, which means 9 different regression functions with 9 different R 2 values). For the first and the last dates weights are not needed, because there we have only one estimation value. The weighting technique is the following: in the second date (2012Q4) we have two regressions with two R 2 values, from which we will calculate two weights (one weight for each regression). For the first regression we divide the R 2 of the first regression by the sum of the R 2 values of the first and second regression. For the second regression we divide the R 2 of the second regression by the sum of the R 2 values of the first and second regression. The sum of the two calculated weights for the second date will be 1. For the third date (2013Q1) we have three regressions, so we need to determine three weights with the same technique, and the sum of these weights will be 1 again. We need to do this for every regression estimation of each date. We determine the estimated values based on the regressions for every case and calculate the average estimated value for every date, using the calculated weights.
In this way we get the estimated average values for which the weighting technique described by the harmonic partial method is used. For this, we need to determine the difference of the estimated values (dt). For the first date we cannot determine the dt, because there is no t-1 value there. The next step is the determination of ht: ht=ht-1+(1/(n-t))), where the n is the total number of dates and t is the rank of the actual date (if we start ranking them from 0). After that we determine the wt values (wt=ht/(n-1)). We need to multiple the dt values with the wt values, add them and in the end we get the coefficients which we will use for the estimation. Consequently, the trend is more weighted by the recent values.
The great advantage of this method is that it is able to handle time-changing effects while also ensuring the greater role of recent values. The disadvantage is that it is computation intensive, and in case of large samples, more than one hundred regressions can be made, which is why it is time-consuming. As in the case of the other forecasting methods, it can be used reliably for short-term or medium-term forecasts, but is not suitable for long-term forecasts.
Source: Own compilation Forecasting sovereign CDS spreads is not an easy task. Several factors, including qualitative (difficult to quantify) variables have an impact on price developments. Conventional forecasting techniques are therefore ineffective. This paper uses the method of creeping trends with harmonic weights to predict the quarterly sovereign CDS spreads for Hungary and Germany, with the smallest prediction error. There are two reasons for choosing these two counties: the availability of data and the importance of the economic relations between them. Additionally, in order to test the method as fully as possible, two different sample sizes and regression element numbers were defined, which was possible for these two countries.
During the analyses SPSS software and Microsoft Excel software were used. The range of variables included in the analysis is not complete; the qualitative factors are not included in this study. Later, in further research the range of the included variables will be expanded. Graphical tests were performed to verify the results.

Dataset
The dependent variable was the five-year USD denominated sovereign CDS premium, using data from the Bloomberg database. For the fulfilment of the regression assumptions, the natural logarithm of the dependent variables was used for the analyses. The following independent variables were used for the two countries: unemployment rate (2010 = 100%), industrial output index (seasonally adjusted and unadjusted, 2010 = 100%), wage index (2010 = 100%), shares (end-of-period prices, 2010 = 100%, refers to the BUX Index/CDAX Index, base January 2, 1991/December 30, 1987), producer price index (all commodities, 2010 = 100%), consumer price index (2010 = 100%), average exchange rate (national currency/USD), nominal effective exchange rate (index), real effective exchange rate (index), export (national currency), import (national currency), GDP deflator (index), GDP (national currency), discount rate (annual percentage; end of period; basic rate at which NBH offers loans with maturity of more than one year to other MFIs), lending rate (average rate charged by other MFIs on loans with maturity of less than one year to nonfinancial corporations, weighted by volume of new credit extended during the last reporting month), treasury bill (annual percentage; weighted average yield on 90-day treasury bills sold at auctions), deposit interest rate (annual percentage), government bond (annual percentage; average daily secondary market yield on ten-year fixedrate government bonds), loan interest rate (annual percentage), total reserve (excluding gold, USD). Each variable was quarterly in order to have a sufficient number of samples for the tests.
For the determination of partial trends the SPSS stepwise multivariable linear regression command was used.
For Hungary, the used time period was 2012 Q3-2016 Q4, as the data were available during this period. This represents a total of 18 quarters, of which 10 sub-samples were formed. The forecast was between 2017 Q1-2018 Q4. For Germany, a larger sample was available: the used time period was 2003 Q1-2016 Q4, which represents 56 periods. Here, the rationalization of the analysis and the control of the larger sample resulted in 30 sub-samples. The forecast also covered the 2017 Q1-2018 Q4 period.

Hungary
Based on the creeping trends with harmonic weights method, the optimal multivariate regression functions were determined in the first step. For Hungary, using 10element samples, this has resulted in 9 different functions (moving every time with a period). Regression analysis requires the fulfilment of number of assumptions, most of which are related to residuals. In most cases, the fulfilment of these conditions was solved by the logarithmic transformation of the dependent variable, using the least squares method (OLS). Multicollinearity was eliminated by the backward elimination method and manual control, and disturbing autocorrelation was tested with Durbin-Watson statistics. The explanatory power of each regression function and the included variables are given in Table 1. In Appendixes 7.3, 7.4 and 7.5 one can see detailed information about the regression functions. Estimation of the partial trends was based on different regressions, which resulted in several estimates for each quarter (excluding the first and last periods) that were weighted by the adjusted R 2 value of the regression functions. The values were used for the harmonic partial trends method, as a result of this the forecast has been completed. (In the prognostic point of view the latest, recent values/changes have a greater role in the determination of the present and future trends. By applying an appropriate weighting system, the examined periods' partial trends also were assigned different weights, thereby ensuring that data closer to the present gain more weight during the forecasting.) During the analysis, the 95-percent confidence interval and standard errors were also determined. The results obtained with the confidence interval as well as standard errors are shown in Figure 2.
Source: Own compilation Figure 2. Forecast of the Hungarian sovereign lnCDS premium with standard error (upper) and 95% confidence interval (lower) In Hungary, the forecast predicts a fall in sovereign CDS spreads. It is important to note that qualitative factors (e.g. credit rating, political news, announcements, etc.) are not included in the analysis. Building them into a model is the next research goal.

Germany
For Germany, the test procedure was the same as described above. Since there are 56 periods (2003Q1-2016Q4) available, the use of 10-element regressions would have been unreasonable, so 30-element samples were defined. This resulted in 27 different partial trends, which were also weighted with the adjusted multiple determinations coefficients. The basic data for the different regression functions are given in Appendixes 1 and 2.
For Germany, the confidence interval moves within a broader range, but it is predicted that there will be a fall in sovereign lnCDS spreads. The results are shown in Figure  3: in the lower part with a 95% confidence interval and in the upper half with the calculated standard errors. and 95% confidence interval (lower)

Validity Tests
As with any statistical test, it is important to check the results, test the estimation and explore the inaccuracies. Therefore, different graphical testing methods have been applied for both countries. Tests concentrate on the reliability of the forecasts, which means to what extent the signs and tendencies of future systematic errors are present in the ex-post errors of the forecast.
The first graphical test examines the relationship between the predicted and the actual values (graphs of the two countries are shown in Figure 4). When interpreting the diagram, the axis starting from the origin at an angle of 45° is the relevant one. In the case of a "fully accurate" forecast, the points are located on the axis but this is rare (or simply does not occur) in practice. For a reliable forecast, the set of points randomly scattered around the axis.
If we look at the Hungarian and German forecasts, we can state that in both cases the precondition for a random set of points around the axis is fulfilled, which means the level of reliability is acceptable.
The second graphical test uses deviations from the averages. Deviations from their own averages have been determined for both the estimated and predicted values. Similarly to the previous graphic test, in this case we can talk about reliable predictions and results if the values are randomly located around the diagonal. Figure 5 shows the results of the test, from which it can be clearly seen that the values are usually around the diagonal, meaning there is no significant systematic deviation in the estimated values. For Hungarian data, since there was a much smaller sample, the results were less spectacular, but this did not affect the interpretation.   In the third and final graphical test, the estimated values are shown as a function of time. The two linear lines represent the envelope curves whose values are determined by the standard errors. For both countries, it can be stated that the values are within the envelope curves, which means that the results are reliable. The graphs are shown in Figure 6.

Source: Own compilation
In order to test the reliability of the method, I also looked at the estimation results out of the sample. Figure 7 shows estimates and true data, not just until 2016, but until the second quarter of 2018. Since I used the data until the end of 2016 to the creation of the forecasting function, the estimate for the next six quarters is out of sample estimation. The figure shows that the forecast is reliable in the short term, but as in the case of other forecasting methods, the deviation increases in the long term.
In the case of Germany we can see bigger differences between the actual and the forecasted results. The reason for this is that in the last few years of the model, the growth rate of the economy was far below what the model could not independently improve. It would be worthwhile to look at how the model responds when the sample is split up, so the financial crisis does not distort the results.
It is important not just to make graphic tests of forecasting, but to calculate analytical tests, too. Accordingly, I calculated various analytical indicators (MAD=Mean Absolute Deviation; MSE=Mean Squared Error, RMSE=Root Mean Squared Error, MAPE=Mean Absolute Percentage Error), the results of which are given in Table 2. (The calculation based on Wallström, 2009). It is worth noting that the indicators are less relevant alone, but in comparison with the results of other estimation procedures, they will say a lot. However, it can be stated that the deviations are low; the forecast does not include any lucrative deviations.

CONCLUSIONS
The purpose of the study was to effectively predict the sovereign CDS spreads by using the creeping trend with harmonic weights method. On the basis of the regressions performed on the partial samples, the weighted estimation can be used to predict the sovereign CDS spreads, using Hungarian and German quarterly, 5-year USD denominated data. According to the graphical tests, the forecasts have an acceptable level of confidence. The method, though complex, is transparent and helps to carry out successful analyses.
Although the method of creeping trends with harmonic weights provides reliable results, it should not be ignored that the qualitative variables are not included in the analysis and that the sample size should be further increased. In the case of forecasts, as values closer to the present gain more weight, careful consideration is important, because recent extraordinary events (such as the 2008 financial crisis, migration crises, terrorist acts, natural disasters, etc.) can distort the results.
In all statistical analyses, it is important to perform the analysis using several methods, different frequency data and different variables to ensure comparability. Due to the framework of the study, comparative analysis does not cover a variety of times, countries and methods, so the results are not suitable for forming general conclusions.
Examination of causal relationships was not the purpose of this study, but it will be important in later phases of research. Understanding the processes behind the examined phenomenon is essential to select the right method and evaluate the results correctly.