Credit Risk Calculation: an application in the Brazilian market using the CreditRisk+ model with uncertainties

Due to an increasing economic instability worldwide, financial institutions are demanding more robust and powerful methodologies of credit risk modeling in order to ensure their financial health. The statistical model CreditRisk+, developed by Credit Suisse Financial Products (CSFP), is widely spread in the insurance market since it is not necessary to make assumptions. This is because the model is based on the default risk, that is, non-payment risk. The main goal of the above-mentioned model is to measure expected and non-expected losses in a credit portfolio. In order to measure default events, the model suggests grouping the debtors in exposure ranges so that the loss distribution can be approached to a Poisson. In the basic model, the default rates are fixed. To portray reality, we propose a new modeling in which the uncertainties and volatilities of default rates are incorporated. In this case, a new model which assumes a Gamma distribution in association with these uncertainties is defined. From the obtained distribution, not only is it possible to calculate the credit VaR (Value-at-Risk) but also the loss distribution and some point estimates, such as the expected loss in a certain period of time and the economic capital allocation. The main goal of this article is the CreditRisk+ model application with uncertainties in a segment of Brazilian industry. The economic capital allocation, that is, the difference between VaR and the expected deprival value is always higher, depending on the proposed modeling (with the incorporation of uncertainties, volatilities and the default rates). Our result is important, since financial institutions can be underestimating their losses in stressful moments.


Introduction
Credit risk is in direct association to the core activity of financial institutions, which is resource trading among agents. Measuring credit risk requires assessing liabilities' degree of value fluctuation. Assaf Neto and Silva (1997) defines credit as trading spot assets/goods for future assets/goods. Credit operations might be seen as the exchange contracts of present values for future payments. Default occurs when the operation counterpart dos not complies with contract terms, failing at one of the payments due date (CHAIA; A.J.,2003).
Credit operations involve an expected default value. Frota (2015) defines credit risk as the non expected default events due to estimation errors in calculating default probability. Part of financial institutions activity refers to monitoring credit recovery as debtors carry out contractual payments period by period.
The main goal of the calculation of credit risk is to correct estimate the loss distribution in a loan portfolio. Loss distribution allows to estimate the expected loss, which is the natural loss within bank transactions and the unexpected loss value at a certain confidence level, or VaR (Value at Risk).
The New Basel Capital Accord (2004) defined that the VaR should be provisioned as collateral until the end of the process. This agreement is intended to avoid bankruptcies of financial institutions. Since the basis of the credit market is the intermediation of available resources, the VaR calculation must be done accurately so that financial institutions do not take unnecessary provisioning of resources. Therefore, a good analysis of credit risk is essential. Due to the importance of VaR measurement, several commercial models that calculate the portfolio's credit risk were developed in the 1990s, such as CreditMetrics, CreditRisk+ and KMV (CHAIA, A.J., 2003). CreditRisk+ is a model introduced by Credit Suisse Financial Products (1997). The purpose of this model is to find expected portfolio losses and unexpected losses for capital allocation purposes. According to Mileo et al CreditRisk + is a unique model for the modeling of credit portfolios considering that it applies actuarial mathematical techniques to estimate the distribution of losses in a credit portfolio.
According to Sanfins and Clark (2010) CreditRisk+ considers the default rates as continuous random variables, assuming the variation of the rates in the analysis in order to incorporate the uncertainty of the variables. Burgisser et al. (1999) point out that CreditRisk+ is easy to implement in practice due to the low number of assumptions, the transparency on the implementation (based on widely known concepts in insurance companies) and has a fairly simple estimation of loss distribution through the use of an iterative procedure.
CreditRisk + methodology is highly used in financial institutions, due to its high sensitivity and, as previously mentioned, the low number of assumptions.
Therefore, the main objective of this work is to perform an application of the CreditRisk + methodology in the data of a Brazilian holding company of the Asphalt Pavement Sector. The sector in question is directly linked to the infrastructure of road transport and productive paving chains. According to data from 2016 published by the Brazilian Institute of Geography and Statistics (IBGE) almost two-thirds of the asphalt consumed by Brazilian construction companies was directed to road works and urban infrastructure. According to data published in the Brazilian Statistical Yearbook for Petroleum, Natural Gas and Biofuels (2018), in 2016 Brazil produced 2, 152, 075m 3 of asphalt, a 6.9 % growth in relation to 2015. Considering the 16 years spam time (2000 to 2016), asphalt consumption grew by 0.9 % per year. This evolution was accompanied by the production of asphalt, which grew in the same proportion in the accumulated period. (FIESP, 2017) Finally, the secondary objective of the article is to obtain the same distribution of Portfolio Loss using Bayesian Inference tools.
The next section will present a brief overview of credit risk models. In the 3 section the CreditRisk+ model and some concepts necessary for the application of the method will be presented. In the section 7 the results of the calculation of Credit Risk on credit portfolio will be presented. Finally, the last section presents conclusions and final considerations on the application of the Credit Risk calculation using the CreditRisk+ model.

CreditMetrics
CreditMetrics created by Morgan (1997) is a method that is based on the risk assessment of a credit portfolio due to a change in the credit rating of the debtors. The application of Creditmetrics requires available data on the debtor's credit rating to calculate the market value of the loan and its volatility.
According to the report published in April 1991 by J.P. Morgan, CreditMetrics is a useful method for all the companies in the world that carry credit risk in the course of their business. The resource provides a methodology for quantifying credit risk across a wide range of instruments, including traditional loans, commitments and letters of credit; fixed income instruments; commercial contracts such as trade credits and accounts receivable; instruments such as swaps, forwards and derivatives.
According to Clark (2013), the CreditMetrics method can be summarized in 3 macro steps.
Step 1 -Estimate the exposure value of each debtor in the portfolio. The intent of this step, according to the author, is to analyze the debtor's credit rating together with the likelihood that his rating will be changed to minimize credit risk. This step is critical to a good calculation of credit risk and a point of attention is to observe if the data is biased.
Step 2 -Calculate the volatility of the exposure value due to the migration of the debtors classification. The calculations of this second step require the probabilities of changes in the credit ratings of the debtor over time and according to the level of the spreads. According to Clark (2013), this debtor rating can undergo upgrades and downgrades. From this information, the volatility of the market value is calculated, that is, the VaR (Value at Risk) of a borrower belonging to a credit portfolio can be calculated. Finally, Step 3, which consists in calculating the correlation between the debtors' ratings and the risk calculation of the portfolio. According to Stolf (2008), the correlation between ratings is calculated through the information from rating agencies. If the portfolio is considerably large you will need help from the computer to perform the calculations. With correlations estimates it is possible to perform simulations on the probability of migration of the debtor and his payments, thus we have the portfolio loss distribution function (Clark; T.M., 2013).

KMV Model
Developed by the KMV Corporation, the KMV Model is based on the Merton model (1974). The Merton Model considers the company's capital as a call option on the underlying value of the company, with an exercise price equal to the nominal value of the company's debt. This method, according to Chen and Chu (2014), introduced the idea of using stock price variation to estimate the probability of default of the company. One of the assumptions of the model is that macroeconomic information is implicit in the company's stock price movement, and this feature made the Merton model a practical and dynamic method when compared to conventional methods. Subsequently, Vasicek and McQuown upgraded Merton's model by building an information database that includes more than 3,400 listed companies and more than 40,000 unlisted companies. Based on this database, the authors discarded the assumption of normal distribution.
The KMV model uses option pricing and does not use rating agency data to calculate the default probabilities as the CreditMetrics model methodology (Stolf, W.A., 2008). The basis for the estimation of the default on the KMV model is the market value of assets.
For KMV, the modeling process can be divided into three stages. • Step 1 -Estimate of market value and volatility of company assets. The variables of the model: value of firm's assets, distribution of assets, volatility of assets and point of default. The KMV model assumes that asset values follow a log-normal distribution. The company is considered in default when the value of the assets is at a lower level than the default point. • Step 2 -Calculating the default distance to ensure accuracy in valuation of assets, the KMV calculates the distance to default before calculating default probabilities. Its distance is calculated by the formula: Were V (a) is the asset's market value, d the default point defined in the previous step, µ the expected return on firm value, also calculated in the previous step and σ the firm value volatility. The default distance represents the number of standard deviations between the average of the asset price distribution and the default point. • Step 3 -Calculating default probabilities. In the final step, the KMV model performs a study to segment the companies that have the same distance to the default and observes how many were defaulted within the time interval evaluated. From the estimated model, matrices to observe and evaluate the probability of a debtor switching rating are constructed, considering a certain time interval. The model calculates the portfolio credit VaR with these estimates. Cash flows are discounted by the risk neutral probabilities obtained by each borrower's formula given below: Where V f is the cash flow, LGD the losses from default, q the probability of default e i a risk-free discount rate. The loss function is estimated by the approximation of a Log Normal distribution, and then we will have as a result the value at credit risk (Stolf; W. A., 2008).

CreditRisk+
The model developed by Credit Suisse Financial Products (1997) is very widespread in the market due to its simplicity, since it disregards the assumptions about the default event and it is not possible to determine the exact moment of default. The CreditRisk+ model considers payment or default to be an event observed only on the due date. Therefore, only two statuses are possible for each individual: defaulter or not default. To measure the default events the model suggests grouping debtors into exposure ranges (L). In addition, one should know or calculate the Loss Given Default (LGD), the loan value that is lost at the time of default. The model exists in two forms, with fixed and variable default rates.
CreditRisk+ fixed rate is a simpler model because it assumes that the individual has a constant probability of defaulting over time. However, if we add interference resulting from economic factors at the fixed rate, it becomes variable reflecting the uncertainties of these factors. In the next sections we will present the CreditRisk+ fixed rate model, the way uncertainty is added to the rate, the variable rate model, the use of grouping by sectors and, finally, the calculation of the loss distribution.

Default events Analysis
Let N be a random variable defined as the total default loss on the credit portfolio. For the analysis of the loss distribution on the credit portfolio with n debtors, the probability-generating function (PGF) on the auxiliary variable z, is given by equation 3.
Let X 1 a random variable representing debtor 1 on the credit portfolio. In the case of default event, the variable assumes the value 0, otherwise it assumes 1: Thus, X i ∼ B(p i ), and p i is the probability of default from debtor i.
The PGF of each debtor can be defined as: Constant default rates indicates that such events are independent, which leads to: Taking the logarithm of equation 6: Thus, assuming P x1 close to zero, we have: In which µ = P xi . The Moments Generating Function (MGF) of a random variable with Poisson(µ) distribution as shown in the equation 8 Thus, N ∼Poisson(µ), that is, Therefore, as can be seen in equation 9, the variable that represents the default number has Poisson distribution (µ).

CreditRisk+ with fixed default rates
The first step in obtaining the distribution of losses is to group the exposures of the portfolio into ranges. For this type of model, we will use the following notations: Besides, we will define the following auxiliary values for each X i , where L is the Exposure at Default from the portfolio. v xi = L xi L e ε xi = λ xi L The main step is to round each v xi to the nearest integer and most often multiple of 10 or 100, reducing the possible number of exposures between debtors. Thus, the portfolio is divided into m exposure ranges, identified by the j index. With respect to each track, we will use the following notations:

Reference
Notation Default exposure at range j v j Expected Loss at range j ε j Expected default events at range j µ j From this we have: Taking µ as the total number of expected events of default in portfolio, we can define: After analyzing the distribution of the loss events, we will proceed to the calculation of the Loss distribution. Let G(z) be the moment-generating function of the losses, expressed as a multiple of the exposure unit (nL).
From the assumption of independent portfolio ranges, we have: Considering each range as a portfolio, the result of nL might be seen as the number of default events (n) multiplied by the range exposure (v j ). In this form we have: Thus: Finally, the recursive relation for the distribution of losses is calculated. Given an integer n, let A n be the probability of a loss of nL. By Taylor's expansion to G, the result is: But considering that: Which give us: Using Leibniz for derivative calculation, we have: But considering that: This is only nonzero if k = v j − 1 for some j. In this case, this term will have µ j (k + 1)!. By definition, we have: Thereby: The recurrence formula is complete when:

Uncertainty at default rates
According to historical data, default rates are not fixed, and vary over time (See Clark (2013)). The variability of these rates may be associated with the change of some related variable to those rates. The state of the economy or even a change on some economic factor can affect a large number of debtors in a similar way. For measuring changing effects, from a given factor over the portfolio, we need to identify how is that factor influences borrowers. The division of the portfolio into sectors occurs by grouping the debtors according to factors of influence that are common among them. The model considers each sector as a subset of the total number of debtors, which is driven by a major factor and in turn will be associated with uncertainty about default rates of the respective debtors. By dividing into sectors, we think of each sector as a portfolio by itself. Thus, we will group them into ranges (within each sector), as we did in the fixed rate model.
we define: And m(k) is the number of ranges from sector k. The average µ k in this case is the expected loss, and from that:

Events with variable default
At this point we are interested in finding the distribution of the default events, and for this we will use the Probability Generating Function. Then, we will define the following family of random variables.
Y k = number of default events in sector k The number of default events in the portfolio will be given by equation 26 From the definition of the Probability Generating Function, we have: Each sector, by definition, is influenced by distinct and disjointed factors. Thus, it is reasonable to assume independence between sectors. This allows us to write: Hence, we will focus on the analysis of one of the sectors, which will lead us to find what we want. Based on the result we have in the fixed rate model and from the definition of F k (z) comes: Assuming that the density of X k is f k , and from the Bayes' Theorem, we have: Rearranging the calculation, we have: It give us: To find an explicit form for our PGF, we will need to appropriately choose a distribution for X k that has mean µ k and variance σ k . The model suggests that we choose the Gamma, its Probability Density Function is represented in the equation 34 The parameters (mean and variance) of the selected distribution are : Gamma function:

Sectoral Analysis Conclusion
By looking at each sector k from the solution for the system, we get: Then, substituting the expression of the density of the Gamma (Equation 34), we have: Making y = x k ( 1 β k + 1 − z), we get: Making the appropriate adjustments in this calculation, we will obtain: In which: p k = β k 1+β k

Probability Generating Function Calculation
Now that we have analyzed the distribution of default events, we will proceed to calculate the loss distribution. Let G(z) be the PGF of the losses, expressed as a multiple of the Base exposure (nL). We have: Since the sectors in which we divided the portfolio were assumed to be independent, it follows that: Let G j (z) be the PGF of losses from sector k. We need to calculate the PGF for each sector. From the Total Probability Theorem, it follows that: If default average value is known, from the model with fixed rates we have: Where: Additionally, a polynomial family is defined as: Which give us: With integral x k , give us: From this, we conclude that the distribution of loss per range of exposure is given by the equation 48. It is worth noting that the generating function corresponds to the loss distribution is nothing less than the product of Probability Generating functions of a known distribution, that is, of a Binomial-Negative distribution.

General Recurrence Relation
In the previous section, the loss distribution function per exposure range was obtained. However, since each range have different parameters, to obtain the portfolio loss distribution it is necessary to apply the function at point zero, through the recursive method presented below.
Assuming the series expansion G , we have: We want to find the coefficients A n . In these sense, we will assume G(z) such that: In which A and B are polynomials. This makes sense since the denominator of the fraction representing G(z) is a polynomial. We will take A and B as follows: Assuming this, we can write: Deriving G, and substituting the terms, we will have the following equality presented in the equation 52 If we make the product on both sides of the equation, we get two power series in z. Then, since the coefficients on both sides of z n must be equal, whatever n, we have: Opening and organizing the expression we will have: Which give us The recurrence relation is complete when we note that:

Convergence of variable rates to fixed rates
Although CreditRisk+ is designed to incorporate the effects of variability into the average default rates, there is a circumstance in which the model behaves as if the default rates were corrected. What we are going to show in this section is that when the standard deviation of the average default rate for each sector tends to zero, convergence occurs between the variable rate model and the fixed rate model. Our discussion will consist of demonstrating that the probability-generating function we find in the case of variable rates converges to the PGF found in the case where the rates are fixed. 6pt Recall that the PGF found in the case of variable rates is: Where: We should observe that when σ k → 0 we will have β k → 0. In addition, as p k = β k 1+β k , we might see that lim β k →0 p k β k = 1. Taking the limit of β k → 0, we might make a proxy of p k . To prove the results, according to these observations, we need to calculate lim According to Credit Suisse Bank (1997), when the standard deviation of the average default rate, for each sector, tends to zero, the probability-generating function of the losses in the variable rate model converges to that of the fixed rate model. Proof: Note that R k (z) does not depend on β k . Using the exponential fundamental limit, we have: This allows us to conclude that: As ranges are given by the same exposure base unit, regardless of sector, equation (3.61) will allow us to group the debtors of different sectors, belonging to the same range. Thus, the sum of k disappears. Our expression, then, will be summarized as follows: This expression is exactly what we find for the PGF of losses in the case of fixed rates. This point ends our demonstration.

Generalizing sectors Analysis
Our analysis so far assumed that the debtors were affected by only one major factor, which determined the sectors in which we would split our portfolio. We will now make a generalized analysis, which considers a debtor being affected by more than one factor.
If we look at equation (3.63) as a multiple integral we will have: We can redefine R k (z) as the sum in sector debtors k: With this information, we can write: Where δ Ak is given by: In order to generalize the sector concept, the function δ is changed by a number θ xik which represents how much the sector's main factor k affects the debtor x i . We will just require that k=1 nx i k = 1. Note that the above case is a particular version of the above relation in which we have θ xik = _x i k. With this, in this more general case, we have: If we redefine the expected value of the losses in the sector k as µ k = xi θ xik ε xi v xi . Thus, our R k (z) will be rewritten as follows: Operating with this new polynomial, we will get the PGF of the losses in a way identical to the particular case that we had seen.

Loss Distribution Analysis -Applying Bayesian Theory
Bayesian theory is an important statistical tool, widely used in finance and economics. In the Bayesian approach, the parameters of the probabilistic model are treated as random variables, modeled by a prior probabilities distribution, formulated according to some previous and subjective knowledge regarding the problem studied.
According to Timpani and Nascimento (2015), the essential characteristic of Bayesian inference is the use of probability to quantify the uncertainties, that is, the degree of confidence that the researcher has about the value of the parameter. Note that Y is the random variable that represents the number of defaults in a portfolio, and Y |µ (µ). Thus, we assign a prior distribution Gamma (α, β) for this µ parameter. An important point to note is that the Binomial Negative distribution we obtained earlier is nothing more than the predictive distribution of µ. theorem 6.1 Let Y be a random variable such that Y |µ poisson(µ). Suppose that the prior distribution of the µ parameter is Gamma(α, β). Then, the predictive distribution of Y is binomial negative Proof: By Bayes theorem, we know that: Changing the variable µ(1 + β −1 ) = x, and using the definition of the Euler Gamma Function, we will have: We therefore find the density of the Negative Binomial as an expression of the Y predictive, which completes the proof.
The result motivates us to make some changes to the model. A simple observation makes us notice that the distribution that best describes the default events is a Binomial (n, p) where n is the (fixed) number of debtors of a portfolio and p will be defined as the mean probability of default in the portfolio: From this definition, we see that the prior distribution that fits best the case is the beta (a, b) which, in addition to being conjugated to the binomial, only assumes values in the range [0, 1]. As we have previously concluded, the distribution of Y will be obtained when we calculate the predictive of the above case. We will show that it will be a Beta-Binomial. theorem 6.2 Let Y be a random variable such that Y |p (n, p). Suppose that the prior distribution of the µ parameter is Beta (a, b). So, the predictive distribution of Y is Beta-Binomial.
Proof: By Bayes theorem, we know that: The expression found is exactly that of the Beta-Binomial probability function. At this point we need to define, as we did for the original model, the parameters of the beta distribution of p in relation to the portfolio data. For this, we recall some properties of this distribution: we can see after some calculations that if µ and σ 2 where the mean and variance of p, the distribution parameters will be given by: For the case where the default rates are fixed, we would obtain the following PGF of the losses in each p(i defaults)z iv k , where n(k) is the number of debtors in the range k and p(i defaults) = This helps us to find the PGF of losses for the case where rates are uncertain. If m(k) is the number of sector range k, n k j the number of debtors of the j sector range k, we can write in the case of uncertain rates: Where P k is the average default probability in sector k. Note that the integral above is exactly the calculation we previously did to find the density of Beta-Binomial. Recall that, since n(k) is the number of debtors of the range k, we say that p k = A∈faixa k p A n(k) .
Knowing that P (i defaults) is the probability function of Beta-Binomial, this allows us to conclude that: With this result, we can write a new model based on CreditRisk+, using Bayesian Inference as a tool.

Data and structure
To calculate the unexpected value (VaR) and the expected loss value (EL) through the CreditRisk+ model, real financial data from a Brazilian holding company in the segment of Asphalt Paving were used. For reasons of confidentiality, the name of the company will not be informed.
The calculation was done on a monthly basis, starting in January 2010 and ending in December 2010. The credit risk estimation using the Creditrisk + model was performed in software R. For the portfolio used in this work, the maturity is 365 days and individuals are part of the same industry. Schuermann (2004) stated that the distribution of losses is bimodal with peaks at 0.25 and 0.75. In order to take a more cautious approach, the LGD (loss given default) value of 0.75 was adopted for all individuals in the portfolio.
The rating matrix (which crosses the default probabilities with the ratings) was defined using the SERASA and Brazilian Central Bank data:  Table 7 it is possible to observe the categories, 'DP' and 'SD' columns show the values for default probability and standard deviation respectively. As can be seen in the Table 7, the further away from the A rating the individual is ranked the higher their probability of "defaulting" and the standard deviation of the default. If the agent is classified as H, for example, it has a probability of 75% default with a standard deviation of 14.4%. Figure 7 presents the CreditRisk+ calculation for the portfolio in January 2010 in which the holding company was exposed in the period. As can be seen in figure 7, the portfolio expected loss (EL) is 1,69 Mio (Mio = 10 6 ), in the graph the expected loss is illustrated by the green line (EL -Expected Loss). Therefore, 1.69 Mio is automatically provisioned as the natural loss from the transactions.
At the 99.9% confidence level, the VaR (blue line), i.e. the unexpected loss value, is 14 Mio. The difference between the VaR and Expected Loss (blue line less the green line) is called Economic Capital Allocation (EC). The EC represents the amount that I must provision in the fund to ensure that in case of an unexpected loss the firm does not go bankrupt. In this case, it will be provisioned 12.31 Mio in the fund.
In turn, the red line of the graph (Figure 7) represents the Expected Shortfall (ES), which is the average loss in the worst scenarios, ie 0.1%. So, if the loss exceeds the VaR, the expected value is 15.47 Mio. One form of a more conservative approach would be to provision the value of the ES in the fund instead of the VaR. The same steps were taken for the other months until December 2010. Table 2 presents the Expected Shortfall values taking into account different levels of confidence. The following charts present the result for each month using the confidence level of 99.9 %.   As can be seen in Figure 3, VaR and ES values are higher at the 99.9 % significance level than at any other levels. Comparing confidence levels allow us to observe the influence of the level on the estimation of VaR and ES. Economic Capital Allocation (VaR -Expected Loss) is the amount that it is advisable to make provision for eventual default situations. Using the 99.9% confidence level is the most conservative form, however, if you used the 99.0% or 95.0% level the Economic Capital would be lower and thus, it would be less credit standing at the bottom.
The graph 7 was constructed in order to visualize how VaR and Expected Shortfall (ES) behaved throughout the year.  Another way to examine this is to compare the scenarios, ie, the results of each level of confidence.

Figure 5: Graphs of results by confidence level
As can be seen in Figure 5, VaR behavior over time is similar to that of ES, regardless of the confidence level. In addition, in all three scenarios presented above the VaR is lower than the ES, this behavior is expected because the ES value refers to the cases when the defaults are larger than those predicted in the VaR.
Again, it is possible to note the difference between significance levels across the different distribution levels on the Y-axis. Thus, VaR and ES values are higher in the 99.9 % confidence level scenario than in the other. It is worth remembering that the Expected Loss (EL) is not an estimate and therefore its value remains fixed regardless of the level of significance.
Then a credit risk analysis submitting the ratings to stress will be carried out, this means thinking about the worst case scenario where an individual is 2 ratings below what he really is. For individuals in the 7th (penultimate) and 8 (last) classifications of the score table, the individual will be considered to be in the last category -8. The stress method is usually used in the market to analyze whether the financial institution could handle losses in a scenario of economic crisis. In September 2010 the holding company had 100 MM as a total of the credit portfolio, so observing the VaR in Table 3 in September with a confidence level of 99.9% represents half of the portfolio in the month. Figure 6: Graph of the results with stress According to Figure 6 it can be observed that the VaR of 99.9% from May to December are around 50 Mio, as the portfolio has a total value of 104 Mio then the total provisioning (VaR of the sum of EL with EC) is 50% of the total value of the portfolio. Therefore, VaR values with stress and 99.9% confidence level compromise the financial institution.  Comparisons between stress scenarios and normal scenarios were performed to demonstrate the influence of the method's choice in the estimation of the loss curve. The use of the scenario with stress is to think of the worst case scenario since it reduces the probability of return of the portfolio. However, it is important to assess whether the financial institution would be able to thrive during times of economic crisis.
The first comparison was made in the Expected Loss (Figure 8), because, as said before, it is the value that is automatically lost in the transactions. Using the method with stress leads to loss 4 times greater than the stress-free method, as can be seen in the graph below. As can be seen in Figure 11, stress VaR is always greater than stress-free, regardless of confidence level. The difference between the VaR under stress is greater than without stress, showing that the confidence level chosen has a great impact on the result. The Expected Shortfall follows the same behavior as the VaR, the difference being that the values are higher as expected.

Figure 10: Comparison between stress and stress-free ES
The value of ES with stress is always greater than the value without stress regardless of the level of confidence. This shows that the method of stress is extreme.
A chart of the Economic Capital Allocation was drawn up in order to illustrate the estimation results for the loss distribution. Economic Capital Allocation is considered here as the unexpected loss, which is the difference between the VaR and the Expected Loss. For the chart below, the confidence level of 95% was used. It is possible to observe in the graph 11 that if the stress method is used, the advisable amount of provisioning would be twice as great as the stress-free method.

Conclusion
In this article, credit granting concepts such as: borrower, savers and probability of default were presented. In addition, the types of risks involved in transactions and methods of calculating credit risk were discussed. The focus of this study was to carry out an application of CreditRisk+ in a portfolio and show the importance of calculating credit risk for companies, especially financial institutions.
It should be noted that a risk management area should periodically monitor expected loss, VaR and CE, as these values impact on the mitigation of bankruptcy risk ? and expected return. Thus, preventive measures can be developed to maintain the institution's solvency, such as creating a fund to withstand losses.
As seen, high values of VaR should be notified to the credit granting area so that it becomes more efficient, in order to improve criteria for choosing its customers. In addition, VaR assists in the calibration of risk-return, i.e., if the credit portfolio is very risky then it is necessary to increase the margin of returns.
The analysis of the results made us conclude that Economic Allocation (EC), that is, the difference between the VaR and the expected loss (EL) is always higher considering the stress method. This result is important since the EC is the amount that it is advisable to provision in a fund for the institution to protect itself in (1-α)% of the time.
As seen in the various graphs presented above, we conclude that the use of different confidence levels impacts the results, which may be crucial for the definition of the provisioned amount in created funds. In addition, when the stress method is used, the values of expected loss value, VaR and ES are considerably larger than without stress. Therefore, the selection of the method used and the confidence level directly affect the estimation of the loss curve.