The Development of an Alternative Method for the Sovereign Credit Rating System Based on Adaptive Neuro-Fuzzy Inference System

The main purpose of this article is to determine the factors affecting credit rating and to develop the credit rating system based on statistical methods, fuzzy logic and artificial neural network. Variables used in this study were determined by the literature review and then the number of them was reduced by using stepwise regression analysis. Resulting variables were used as independent variables in the logistic model and as input variables for ANN and ANFIS model. After evaluating the models and comparing with each other, the ANFIS model was chosen as the best model to forecast credit rating. Rating determination was made for the countries that haven’t had a credit rating. Consequently, the ANFIS model made consistent, reliable and successful rating forecasts for the countries.


Introduction
Problems which occur during a global recession or decline periods affect all countries first and foremost developing countries.Countries lose their debt discharging competence and economic woes have seen almost each point of economic life.Independent credit rating agencies evaluated for government bonds in the point of predicting these kinds of problems determine credit ratings for countries and evaluate possibilities debtors failed to pay.
For credit rating studies some statistical methods such as regression analysis [1] [2], logit and probit regression analysis [3] and discriminant analysis [4] are often used.But nowadays, determining non-linear relationships [5] instead of determining the existence of only linear relationships between variables gained importance.For that reason, advanced techniques such as neural networks, support vector machine [6], have been applied.When several studies in literature were examined, credit rating was handled on the basis of enterprises and classification problem not on the basis of countries.Besides, any credit rating estimation was made for the countries which haven't got credit rating except [2].In this study, rating application was carried out on the basis of countries in order to fill the gap in the literature.While performing this, assessments of three large credit rating agencies (Moody's, S&P and Fitch) were considered.Also statistic, math and econometric models were used together with both comparative and supporting each other for credit rating application.Finally, credit prediction of 21 countries of which credit rating was not determined until today was carried out.Consequently, it is thought that this study was original and important either in respect to the methods used or in respect to determining the supremacy and deficiency of a method.

Sovereign Credit Rating and Related Works
There is a growing interest to sovereign credit ratings in recent years.The risk assessment performed by the rating agencies that represent the obligation of governments.A rating is a prospective forecast of the default risk.Sovereign ratings are not "country ratings".There is an important differentiation between them.Sovereign rating is the credit risk of the national governments not the specific default risk of other issuers [7].Governments usually look for credit ratings to ease their own reach to international capital markets.Sovereign credit ratings are determined by using some macroeconomic-qualitative factors.Although sovereign credit ratings are assigned by the credit rating agencies, lots of questions are in governments minds related with the ratings' rationale and consistency.The real question is "how clear the factors affect sovereign credit ratings are" [1].In this study, it is tried to determine the factors affecting the sovereign credit ratings and an alternative model to assign ratings for the countries is developed.Related works with the sovereign-credit ratings are presented as follows.
Basic variables such as income per capita, gross domestic product (GDP), growth rate, inflation, fiscal balance, external balance, external debt, default background and development sorting which are used for credit valuableness in the study carried out by [1] which was shown as a reference point for almost all studies regarding the credit rating.Direction and volume of Country ratings and relationship between the factors determining the ratings were tried to determine by regression analysis.[8] used the data of S&P and Moody's in order to analyze the numeric data of credit ratings by dividing into two parts as countries have higher ratings and lower ratings.
As the most important result of the study, it has been expressed that ratings can't be explained only with economic and financial indicators.In [3] classification methodology with neural networks and aligned probit analysis comparing was carried out for credit rating.Credit ratings were used as dependent variable, foreign debt/export, financial balance, external balance, inflation rate, gross national product (GNP) per capita, growth rate, development situation of the country was used as an independent variable.[9] used variables of political stability, government efficiency, superiority of law and illegality in order to determine how official bodies affect the political organization's credit rating.[10] included corruption perception index, the default history, commercial gap, position of a country in the world, democracy index, source of commercial laws, population and petrol production situation along with macro-economic variables into their models and determined the existence of a negative relationship between corruption perception.In the study, where political violence, diplomatic pressure, illegality, military domination, religious trends, effectiveness of laws, structure of democracy and foreign direct investment data were used [11] not only the macro-economic variables but also the qualitative variables were provided.In this study, methodologies of credit rating agencies were handled and even GDP per capita variable could affect credit rating 80%.[12] discussed credit rating agencies and their effects on developing countries.Handled mentioned agencies within the frame of Basel 1 -2 criteria, examined their methodologies and tried to explain qualitative and quantitative methods in details. [2] determined ratings by using regression analysis for the countries which were not included in to Credit rating by Moody's Fitch and S&P.Credit ratings and GNP per capita, GDP per capita, reserve ratios, GDP per capita volatility, inflation and superiority of law were used as explanatory variables.Most of the predictions made for the countries which have no rating were predicted as "B" and over.[13] examined the relationships between economic freedom, credit ratings and situation of default of country.Probit analysis and Tobit analysis were used for this study.[14] used the method to compare economic growth which was considered to affect credibility, human development and political stability.As a result of the multiple regression analysis, GDP per capita, internal debt, current account balance and human development which was adapted to inequity, affected debt discharging liability negatively and unemployment and political stability affected debt discharging liability positively.[15] searched the reasons of change of credit ratings in developing markets and how changes of credit ratings in countries affected the bank credibility.Credit rating changes were used as dependent variable and economic freedom index, corruption perception index, property rights, income per capita, inflation, current account balance, financial balance and external debt were used as independent variable.

Variable Selection Methodology
According to [16], the most significant point in credit rating studies existing variables which symbolize the problems as possible as fewer and has strong representational ability.Due to the variable selection, the dimensions of variable space are decreased to provide effective working of algorithm [17].When the studies carried out for variable selection were assessed, it is observed that many methods were used.E.g. [18] [19] used Kernel principal components analysis, [20], [4] used linear discriminant analysis, [17] used genetic algorithm, [21] used one way variance analysis (ANOVA), [22] used one way ANOVA, factor analysis and stepwise regression methods.In this study four different methods were implemented separately for variable selection and best considered stepwise regression analysis were preferred.

Logistic Regression Analysis
Simple and multiple linear regression models could be predicted by ordinary least squares (OLS).But due to the dependent variable is qualitative (discontinuous, categorical) OLS predicts are not reliable.For that reason, alternative models were developed such as logit and probit [23].Logistic regression is a special condition of linear regression.But while a dependent variable could take any numeric value in logistic regression, this value should be dual or categorical [24].In [16] and [25], logistic regression analysis is mentioned which successfully implemented statistical technique on credit rating studies and many fields.

Artificial Neural Network
Artificial neural network (ANN) is an advanced mathematical technique which uses intelligent learning paradigms and having several implementation fields such as social, science and engineering fields.The architectural structure of model consists of three layers such as input, hidden and output [26].In [27] each node in input layer transfers the value belonging to independent variable to the intermediate node and data coming to intermediate layer are combined in determined rules and transformed then mapped to target value in output layer.There is only one node in artificial neural network output layer which has been founded for credit rating.Artificial neural networks not to require to provide independent variables distributive characteristics or assumptions and they could model all non-linear relationships between input-output variables [28].

Adaptive Neuro Fuzzy Inference System
Ordinary mathematical method and tools are insufficient to model the systems which haven't been defined well or uncertain systems.In contrary, fuzzy inference systems (FIS) can obtain better results by including human knowledge and reasoning process by fuzzy "if-then" rules.Fuzzy modeling was developed firstly by [29] and implemented several supervision, predict mechanisms.Adaptive Neuro Fuzzy Inference System (ANFIS) structure is the condition where FIS adapted to adaptive networks.Due to ANFIS hybrid learning algorithm fuzzy "if, then" rules and human knowledge reveal input output structure.ANFIS model which was firstly developed by [30] was used then for modeling the non-linear problems, control systems and solution of chaotic time series problems.Double input (x and y) and double fuzzy "if, then" rule could be mentioned by Takagi Sugeno type ANFIS Equations ( 1) & (2).
Functions of node in each layer of ANFIS architecture and so the functions of layers are following respectively [31] [32] [33] [34] [35].( ) ( ) There are total four nodes for both inputs in the second layer.In this layer generally continuous or partial triangle, trapezoidal or bell shaped curve membership functions is used as membership function.
Equation ( 4) which was formed by using a bell shape curve (Gaussian) membership function density function could be used in each node for i A and i B expressions in order to calculate 0-1 membership levels.
( ) Here i m and i σ show the mean and standard deviation of the bell shaped curve membership function respectively.Parameters which are used in the meaning of "premise parameter" are adjusted while the network was being trained in this layer.
3 rd layer: Each node was labeled by π in this layer and represents the multiply of all input signals.Here each node outputs which represents the firing strength of each rule is calculated by Equation ( 5).
( ) ( ) 4 th layer: Outputs of node shown by N labeled circle in this layer means the normalized threshold of the rules.Mentioned threshold could be calculated by Equation ( 6). , 1, 2 5 th layer: Each output of i node which was shown by square in this layer could be calculated Equation (7).
( ) In equity, i µ′ is the output of fourth layer and shows normalized firing strength., , p q r Parameter sets are used in the meaning of consequent parameter.
6 th layer: Node in this layer was expressed by circle and labeled by Σ .Total output consisted in this layer (f) is calculated by Equation ( 8) as the sum of all coming signals.

Data
Data of credit ratings of countries were compiled from the reports of three largest credit rating agencies as dependent variables.For that reason, the letter points of Moody's, Standard & Poor's and Fitch were transformed to numeric ratings by using a scale transformation and their averages were taken.
A variable pool was organized for the factors affecting credit rating, so country risk after literature research result and data belonging to those variables and 2011-2013 years were collected for 180 countries over the world.Data belonging to three years is used as cross section data as separate units by not considering the time factor.The purpose of this increasing safe estimate ratio by providing ANFIS models better learning with more samples and neural networks.Due to deficiency of some data belonging to some countries, some countries were removed from the analysis.Data belonging to totally 230 units could be collected completely.Used variables and information where they obtained were submitted in Appendix A.

Variable Selection Methodology
Factor analysis, linear discriminant analysis, square discriminant analysis, stepwise regression analysis implementations were carried out in order to decrease the numbers of variable by selecting from the variable pool which was formed after a literature search.As a result of factor analysis, determined four factors.But we realized that if the number of samples increases, factor loads will change.So we decided not to use factor analysis in variable selection.When common variables which were used in similar studies were considered study was continued by the variables obtained from the regression analysis.The data set should provide some assumption in parametric analysis.For that reason, variables were examined whether they are suitable for normal distribution and normality assumption was tried to provide by logarithmic transformations.Transformed variables were renamed by adding "LG" code.After the normality test, multi-collinearity problem examination was carried out and some variables which have higher Variance Inflation Factor (VIF) values were removed from the analysis.

Credit Rating Prediction Models
Credit rating prediction models are generally used as classification or clustering except in this study.We investigate this problem as directly credit rating prediction as points, by using some determinants of ratings.There have been lots of determinants for the credit rating problem so we decided to decrease the number of determinants.After completing the variable selection process by using stepwise regression analysis; logistic regression analysis, artificial neural network and ANFIS model were implemented in order to determine the relationship of selected variables to credit rating.Finally, model performances were evaluated and predicts were made.In logistic regression analysis, which is implemented for credit rating estimate, the dependent variable was coded as (0 -1) and possibility values which were calculated as analysis result were evaluated as default risks.76% of 230 pcs data were shared for training, 13% were shared for test and 11% were shared for validation for ANN and ANFIS models.For assessing model performances, total correct classification percentage and mean absolute error (MAE) scales were used.After the analysis, credit rating estimates were made for the countries which haven't got credit ratings and models were compared.

Variable Selection Model Results
Variables determined by stepwise regression analysis in order to use for estimation models were submitted in Table 1. Here; LGGCI is global competitiveness index, LGCAB% is current account balance % of export, LGRL is the rule of law, LGDebtS is debt service and LGDEF is GDP Deflator.All variables are logarithmic forms.The "grade" is the dependent variable in all models that represents credit rating of countries.

Logistic Regression Results
At this stage, variables obtained from stepwise regression analysis were used as explanatory variables.The categorical dependent variable has been formed with the classification which was made by credit rating agencies such as "investible" and "non-investible".For that reason, "1" has been designated for the units which has credit note over 60 and "0" has been designated for the other units.As a result of logistic regression analysis, group memberships of countries were estimated and non-default possibility (being investible country) has been calculated.
In Table 2, several explanatory coefficients used for model selection are seen and in Table 3, it is seen that the model ( )  in fourth step according to the results of the Hosmer Lomeshow test which was implemented in order to assess model data compatibleness.
In Table 4, below logistic regression model obtained by forward selection method is as Equations ( 9)- (10).
A correct classification percentage which was realized by using that model as 0.88.This value is significantly higher.(The correct classification percentage was realized 72% in [36] ANN model, 75% in [2] and 92.4% in [37].)But the possibilities obtained from logistic regression model and credit notes comply with each other.In another saying, it is not proper to transform possibilities to credit notes.That reduces the advantage of the model.

ANN Results
Here the relationship between dependent and independent variables was determined by the multi-layer perception (MLP).Graphic examinations revealed that credit note was in the same direction with RL, CAB and GCI variables and opposite direction with DebtS and DEF variables.Parameters about ANN architectural structure and obtained error values are provided in Table 5.

ANFIS Results
The variables selected by stepwise regression analysis were used in ANFIS model.But ANFIS model doesn't generate good results if there are more than 4 inputs due to the rule base enlarging as [30].For that reason, in order to determine the variable which causes the highest error, tests were carried out with quart variable groups (five group) and it has been decided to use the GCI, CAB, RL and DebtS LGDEF (X1) LGCAB (X2) LGRL (X3) LGGCI variables.Also model with five variables were trained by two membership function, but good results were not taken.When mean absolute percentage errors (%MAE) related to ANFIS model in Table 6 were examined and compared with in Table 5, it is understood that it was trained well compared to ANN and could make better estimations with lower error percentage.
Figure 1 and Figure 2 shows the training errors trend of ANFIS model addition to MAE statistics in Table 6 which is an indicator of whether the network was trained or not.As seen both errors in percentage (E%) and absolute percentage errors (AE%) trends approach to zero by decrease rapidly.The horizontal axis represents the sample number.
Also, it is seen in the graphics that errors belong to 60 and 62 numbered units are extremely large.When these units were excluded to obtain a more realistic value, MAE% value for training data was reduced 0.0771 to 0.0684.
While prediction success was 87.13% in ANN model, the higher accuracy percentage was obtained as 90.66% in ANFIS model.Here it is seen that ANFIS model can comprehend nonlinear relationships between variables successfully.

Conclusions
The sovereign credit rating is very important for country and other issuers, macro and micro level.Investors want to make their investment in the country have   a good rating.Good rating means, lower stock cost, lower interest rate, lower investment cost and higher profit for any country or firm.In this research LR, ANN and ANFIS models were compared and credit rating predictions were made for the countries which have not.When several studies were examined about credit rating, these are seen as micro rating applications such as company or bond rating.Most of these studies handled the problem as a classification problem.Designed models here handled the credit rating problem as country risk graded and configured directly for predicting credit rating estimation.This study is considered to contribute to literature in respect to trying different statistical methods during variable selection, determining ANFIS model as the best among several prediction methods, success of credit rating prediction and risks of 21 countries firstly measured.
Besides the main targets of this study, another examined issue is whether group membership possibilities could have transformed into credit ratings.Even group membership shows significantly good predictions for countries which have higher credit ratings; it was not same for the countries which have lower credit ratings.It is clear that LR credit rating prediction which has 88% correct accuracy classification success is unsuccessful in respect to credit rating estimation.
ANN and ANFIS are the models which learn the relationships over case studies and generate predictions.For that reason, it should be noted that as the number of samples increases, the correct estimation rates increase.Also, it is important that obtained data should be reliable.Relationships learned from incorrect data cause incorrect predictions.These models are considered useful to determine more complicated relationships instead of simple linear relationships.But due to these complicated relationships, it cannot be expressed by a simple equation; prediction equation could not be revealed after analysis.
ANFIS method which was the best among three prediction models with 91% accuracy percentage was used for first credit rating predictions of 21 countries (Appendix B).Thereby the developed ANFIS model proved its prediction success on the verification data set.Consequently, it was revealed that ANFIS model is the most proper model in order to measure country risks and assign credit ratings and it could be used trustfully.
ANFIS model is selected as the best prediction model because of its mathematical hybrid structure and learning algorithm.All possible structure and parameters are tried for LR and ANN.For the future research, it's possible to apply another artificial intelligence technic or heuristic-metaheuristic search technic for variable selection and credit rating prediction.

1
st layer: Each node in this layer transfers the input signals to another layer without implementing any collecting or activation process. 2 nd layer: Node shown by square in this layer represent i A and i B fuzzy clusters.The output values of these nodes are the membership levels bounded to input values and used membership functions (Equation (3)).

Table 4 .
Forward selection method results.

Table 5 .
ANN model parameters and error results.

Table 6 .
ANFIS model parameters and error results.