Transcript validation_of_rating_system
Validation of Rating System
Datamining-Solutions
1
Outline
What is validation of rating systems?
Two components of validation of rating systems discrimination, calibration.
Discrimination methods Calibration methods
Datamining-Solutions
2
What is validation of rating systems?
Datamining-Solutions
3
What is validation of rating systems?
Having set up a rating system, it is obvious that we wants to assess its quality. Validation of rating system rely on using a lot of distinguish methods to assess its quality.
There are two dimensions along which rating systems are commonly assesed:
discrimination
and
calibration 4
Datamining-Solutions
Components of validation of rating systems
Datamining-Solutions
5
Components of validation of rating systems Discrimination
: In checking
discrimination
, we ask:
How well does a rating system rank borrowers according to their probability of default (PD)?
Calibration
: When examining calibration, we ask: How well do estimated PDs match true PDs?
6
Datamining-Solutions
Discrimination methods
Datamining-Solutions
7
Discrimination methods
Accrording to Basel Committee on Banking Supervision we can mention the following statistical methodologies for the assessment of discriminatory: Cumulative Accuracy Profile (CAP), Accuracy Ratio (AR), Receiver Operating Characteristic (ROC), ROC measure (AUC) approximated by Mann-Whitney statistic, Pietra Index – approximated by Kolmogorov-Smirnov statistic, Conditional entropy, Kullback-Leibler distance, Conditional Information Entropy Ratio (CIER), Information value (divergence, stability index),
8
Datamining-Solutions
Discrimination methods
Accrording to Basel Committee on Banking Supervision we can mention the following statistical methodologies for the assessment of discriminatory (continue): Bayesian error rate, Kendall’s τ and Somers’ D (for shadow ratings), Brier Score.
9
Datamining-Solutions
Receiver Operating Characteristic (ROC)
prediction default nondefault default actual nondefault TP FN FP TN
as a function of cutt-off
Datamining-Solutions
10
Receiver Operating Characteristic (ROC)
Datamining-Solutions
11
Receiver Operating Characteristic (ROC)
PD 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,1 0,1 0,1 0,1 0,1 0,1 0,1 0,1 0,1 0,1 0,1 0,2 0,2 0,2 0,2 0,2 0,2 0,2 0,2 0,2 0,2 0,2 0,2 0,2 0,3 0,3 0,3 0,3 0,3 is_default
avg_PD
0,16 total 1 0,9 0,8 0,7 nondefault default 3 7 5 9 0,6 0,5 0,4 0,3 0,2 0,1 0 10 8 7 9 13 11 2 84 2 1 0 0 0 0 0 16 4 4 2 3 cum_toal 7% 18% 25% 37% cum_nondef cum_def 4% 12% 18% 29% 25% 50% 63% 81%
KS
49% 58% 65% 74% 87% 98% 100% 40% 50% 58% 69% 85% 98% 100% 94% 100% 100% 100% 100% 100% 100% 21% 38% 45% 53% 53% 50% 42% 31% 15% 2% 0% 53,27%
AUC
0,004 0,036 0,069 0,146 0,250 0,343 0,426 0,533 0,688 0,819 0,843 84,26%
AR
0,009 0,050 0,089 0,176 0,281 0,368 0,438 0,528 0,658 0,768 0,788 68,53%
Datamining-Solutions
12
Receiver Operating Characteristic (ROC) (the first approach)
The area A is 0.5 for a random model without discriminative power and it is 1.0
for a perfect model. It is between 0.5 and 1.0 for any reasonable rating model in practice.
Call: input: Matlab file: ROC.m
[xy,AUC]=ROC(ratings, defaults) ratings – column vector of rarting value (higher value denote more risky) defaults – 1 denote default, 0 denote non-default Output: xy- points collection to plot ROC, AUC- Area Under Curve ------------------------------------------------------------------------------------------------------------- Matlab file data example: capexample.mat
13
Datamining-Solutions
Receiver Operating Characteristic (ROC) (the second approach)
Call: Matlab file: groc.m
[AUC,AUC_m]=groc(pd,is_default,spos,is_pic) input: pd – column vector of rarting value is_default – 1 denote default, 0 denote non-default spos – three aproaches is_pic – show curve Output: AUC- Area Under Curve using empirical data AUC_m - Area Under Curve using aproximation
Datamining-Solutions
14
ROC measure (AUC) approximated by Mann-Whitney statistic
Assumption:The scores of the defaulter and the non-defaulter can be interpreted as realisations of the two independent continuous random variables S D and S ND The area under the ROC curve (AUC) is equal to the probability that S D smaller rating score than S ND .
AUC=P(S D
U
(
ND N
,
D D u N D
,
ND ND
Û of Mann where Û is defined as
u D
,
ND
1 , 0 ,
if if S D S D
S ND
S ND
15
Datamining-Solutions
ROC measure (AUC) approximated by Mann-Whitney statistic
Matlab file: AUC_Whitney.m
Call: [U]=AUC_Whitney(ratings, defaults) input: ratings – column vector of rarting value (higher value denote more risky) defaults – 1 denote default, 0 denote non-default Output: U - the test statistic Û of Mann-Whitney ------------------------------------------------------------------------------------------------------------- Matlab file data example: capexample.mat
Datamining-Solutions
16
Pietra Index – approximated by Kolmogorov-Smirnov statistic
It is possible to interpret the Pietra Index as the maximum difference between the cumulative frequency distributions of good and bad cases.
Pietra index
max
F good cum
F bad cum
Interpreting the Pietra Index as the maximum difference between the cumulative frequency distributions for the score values of good and bad cases makes it possible to perform a statistical test for the differences between these distributions.This is the Kolmogorov-Smirnov Test (KS Test) for two independent samples.
The null hypothesis tested is: The score distributions of good and bad cases are identical. It mean that when the null hypothesis wil be rejected so significant differences exist (discrimination ).
between the rating values of good and bad cases
17
Datamining-Solutions
ROC curbe model
Y=normcdf( a + b * norminv(x) )
Datamining-Solutions
18
Pietra Index – approximated by Kolmogorov-Smirnov statistic
Matlab file: Call: input: pietra.m
[pietra_index,H,confidence_level]=pietra(rating,is_default,q) ratings – column vector of rarting value (higher value denote more risky) is_default – 1 denote default, 0 denote non-default q - significance levels (default q=0.05) Output: pietra_index - asymptotic P-value H : 1-The null hypothesis was rejected (discrimination) 0 The null hypothesis wasn’t rejected confidence_level – 1-q (default 95%)
19
Datamining-Solutions
Cumulative Accuracy Profile (CAP) and Accuracy Ratio (AR)
We present two ways of calculation of Cumullative Accuracy Profile and Accuracy Ratio: (1) the first approach: calculation based on sorted rating e.g. (AA,B...), (2) the second approach: calculation based on rating which is number without classifying to concrete well-known rating e.g. (AA,B...).
Characteristic of the first approach (discrete approach):
calculation based on every rating so we have the same number of points on the curve as number of group of rating,
advantage:
this way is less risky because we avoid sorting problem
disadvantage
: the curve is less accurate (number of points=number of distinct ratings
Characteristic of the second approach (continuous approach):
calculation based on every observations (so we have the same number of points on the curve as number of observation,
advantage:
the curve is more accurate than first approach
disadvantage
: this way is more risky because in the case the same value of rating can occur sorting problem
20
Datamining-Solutions
Cumulative Accuracy Profile (CAP) (the first approach)
Datamining-Solutions
21
Cumulative Accuracy Profile (CAP) (the first approach)
The cumulative accuracy profile (CAP) provides a way of visualizing discriminatory power.
The key idea is the following: if a rating system discriminates well, defaults should occur mainly among borrowers with a bad rating.
To graph a CAP, we need historical data of ratings and default behavior.
The example was presented on the below picture
Datamining-Solutions
22
Accuracy Ratio (AR) (the first approach)
An accuracy ratio (AR) condenses the information contained in CAP curves into a single number. It can be obtained by relating the area under the CAP but above the diagonal to the maximum area the CAP can enclose above the diagonal. Thus, the maximum accuracy ratio is 1.
We compute the accuracy ratio as A/B, where A is the area pertaining to the rating system under analysis, and B is the one pertaining to the ‘perfect’ rating system.
23
Datamining-Solutions
Cumulative Accuracy Profile (CAP) (the first approach)
Call: input: Matlab file: CAP.m
[xy,AR]=CAP(ratings, defaults) ratings – column vector of rarting value (higher value denote more risky) defaults – 1 denote default, 0 denote non-default Output: xy- points collection to plot CAP, AR- Accuracy Ratio ------------------------------------------------------------------------------------------------------------- Matlab file data example: capexample.mat
Datamining-Solutions
24
Cumulative Accuracy Profile (CAP) (the second approach)
Call: input: Matlab file: cap_continuous.m
[AR]=cap_continuous(pd,is_def) pd – column vector of rarting value is_def – 1 denote default, 0 denote non-default Output: AR- Accuracy Ratio
Datamining-Solutions
25
Conditional entropy, Kullback-Leibler distance
Consider as rating system that, applied to an obligor, produces a random score S. If D denotes the event “obligor defaults” and D denotes the complementary event “obligor does not default”, we can apply the information entropy H to the P(D |S), the conditional probability of default given the rating score S. The result of this operation can be considered a conditional information entropy of the default event,
H
(
P
(
D
|
S
)) (
P
(
D
|
S
) log
P
(
D
|
S
)
P
(
D
|
S
) log
P
(
D
|
S
)) and as such is a random variable whose expectation can be calculated. This expectation is called
Conditional Entropy
of the default event (with respect to the rating score S), and can formally be written as
H s
H
(
P
(
D
|
S
))
E
[
P
(
D
|
S
) log
P
(
D
|
S
)
P
(
D
|
S
) log
P
(
D
|
S
)]
The Conditional Entropy of the default event is at most as large as the unconditional Information Entropy of the default event, i.e.
For the empirical default rate :
H p
H
(
P
(
D
))
E
[
P
(
D
) log
P
(
D
)
P
(
D
) log
P
(
D
)]
26
Datamining-Solutions
Receiver Operating Characteristic (ROC)
An analytic tool that is closely related to the Cumulative Accuracy Profile is the Receiver Operating Characteristic (ROC). The ROC can be obtained by plotting the fraction of defaulters against the fraction of non-defaulters. The two graphs thus differ in the definition of the x-axis.
A summary statistic of a ROC analysis is the area under the ROC curve (AUC).
Reflecting the fact that the CAP is very similar to the ROC, there is an exact linear relationship between the accuracy ratio and the area under the curve: (AR)=2 × AUC−1
Datamining-Solutions
27
Conditional entropy, Kullback-Leibler distance
H can be interpreted as a measure of chaotic character.The difference of H(p) and H S should be as large as possible because in this case the gain of information by application of the rating scores would be a maximum:
HPS
H
(
p
)
H
s
max For the normalization case: we get Conditional Information Entropy Ratio (CIER):
CIER
s
H
(
p
)
H
s
H
(
p
) The value of CIER will be the closer to one the more information about the default event is contained in the rating scores S.
28
Datamining-Solutions
Conditional Information Entropy Ratio (CIER)
Matlab file: Call: input: CIER.m
[wsk, HPS]=cier(pd,is_default,spos) pd – column vector of rarting value (higher value denote more risky) is_default – 1 denote default, 0 denote non-default spos – various approaches Output: wsk-CIER normalised form of conditional entropy HPS – unnormalised form of conditional entropy
Datamining-Solutions
29
Conditional Information Entropy Ratio (CIER)
The Kullback Leibler divergence can be coputed as follows:
D
(
def nondef
)
s
P
(
s
/
def
) log 2
P
(
s
/
def
)
P
(
s
/
nondef
) This expression can be interpreted as a information divergence (information gain, relative entropy ) between a scoer density for the default and nondefault population.
Becouse of its unsymetrically character its more comfortably to use another form as a System Stability Index (SSI)
SSI
D
(
def nondef
)
D
(
nondef def
) of course both of these vaues should be as much as it is possible
Datamining-Solutions
Conditional entropy, Kullback-Leibler distance
Matlab file: Call: input: kullback_leibler.m
[D_DN, D_ND, SSI]=kullback_leibler(pd,is_default,spos) pd – column vector of rarting value (higher value denote more risky) is_default – 1 denote default, 0 denote non-default spos – various approaches Output: D_DN – distance from f(D) to f(ND) D_ND - distance from f(ND) to f(D) SSI - System Stability Index
Datamining-Solutions
31
Bayesian error rate
Denote with p D the rate of defaulters in the portfolio and define the hit rate HR and the false alarm rate FAR as above. In case of a concave ROC curve the Bayesian error rate then can be calculated via
Error rate
min
c
(
p
D
( 1
HR
(
C
)) ( 1
p
D
)
FAR
(
C
)) As a consequence, the error rate is then equivalent to the Pietra Index and the Kolmogorov-Smirnov statistic.
32
Datamining-Solutions
Bayesian error rate
Matlab file: Call: input: bayesian_error_rate.m
[ber]=bayesian_error_rate(rating,is_default,spos) rating – column vector of rarting value (higher value denote more risky) is_default – 1 denote default, 0 denote non-default spos – various approaches Output: ber - Bayesian error rate
Datamining-Solutions
33
Kendall’s τ and Somers’ D
Kendall’s τ and Somers’ D are so-called rank order statistics, and as such measure the degree of comonotonic dependence of two random variables. The notion of comonotonic dependence generalises linear dependence that is expressed via (linear) correlation. In particular, any pair of random variables with correlation 1 (i.e. any linearly dependent pair of random variables) is comonotonically dependent. But in addition, as soon as one of the variables can be expressed as any kind of increasing transformation of the other, the two variables are comonotonic. In the actuarial literature, comonotonic dependence is considered the strongest form of dependence of random variables.
Kendall noted that the number of concordances minus the number of discordances is compared to the total number of pairs, n(n-1)/2, this statistic is the Kendall's Tau a:
a
[
n
(
n
1 ) /
D
2 ]
34
Datamining-Solutions
Kendall’s τ and Somers’ D
Kendall’s τ and Somers’ D are so-called rank order statistics, and as such measure the degree of comonotonic dependence of two random variables. The notion of comonotonic dependence generalises linear dependence that is expressed via (linear) correlation. In particular, any pair of random variables with correlation 1 (i.e. any linearly dependent pair of random variables) is comonotonically dependent. But in addition, as soon as one of the variables can be expressed as any kind of increasing transformation of the other, the two variables are comonotonic. In the actuarial literature, comonotonic dependence is considered the strongest form of dependence of random variables.
Kendall noted that the number of concordances minus the number of discordances is compared to the total number of pairs, n(n-1)/2, this statistic is the Kendall's Tau a:
a
[
n
(
n
1 ) /
D
2 ] and Sommers’D:
SomersD
[
C
C
D
D
T
]
35
Datamining-Solutions
Kendall’s τ and Somers’ D
Matlab file: Call: tau_somersd .m
[Tau,SomersD,Tau_a,Gamma]=tau_somersd(pd, is_default) input: pd – vector of estimated default from model is_default - vector of the real pd Output: Tau –Tau calculated using Matlab function corr.m
SomersD –value of SomersD Tau_a – Tau calculate is traditional way Gamma – the same value as SomersD in case there aren’t the same value of pd (T)
36
Datamining-Solutions
Brier Score
The Brier score is a method for the evaluation of the quality of the forecast of a probability. It has its origins in the field of weather forecasts. But it is straightforward to apply this concept to rating models. The Brier Score is denifed as RMSE (root mean squared error)
Brier score
i N
1 (
d
i
PD
i
) 2
N
where i indexes the N observations, d i is an indicator variable that takes the value 1 if borrower i defaulted (0 otherwise), and PD i is the estimated probability of default of borrower i.
the Brier score lies between 0 and 1, better default probability forecasts are associated with lower score values.
37
Datamining-Solutions
Brier Score
Matlab file: Brier.m
Call: input: [out]=Brier(PDs, defaults) PDs – vector of estimated default from model default - vector of the real pd Output: out –Brier Score
Datamining-Solutions
38
Calibration methods
Datamining-Solutions
39
Calibration methods
Accrording to Basel Committee on Banking Supervision we can mention the following methodologies assessing the quality of the PD estimates: Binomial test, Normal test, Normal test with asset correlation, Traffic lights approach, Chi-square test (Hosmer-Lemeshow ).
40
Datamining-Solutions
Binomial test
In many rating systems used by financial institutions, obligors are grouped into rating categories. The default probability of a rating category can then be estimated in different ways.
Regardless of the way in which a default probability for a rating grade was estimated, we may want to test whether it is in line with observed default rates.
From the perspective of risk management and supervisors, it is often crucial to detect whether default probability estimates are too low.
On the start we can assume that defaults are independent (so default correlation is zero). The number of defaults D kt in a given year t and grade k then follows a binomial distribution. The number of trials is N kt , the number of obligors in grade k at the start of the year t; the success probability is PD kt , the default probability estimated at the start of year t.
41
Datamining-Solutions
Binomial test
At a significance level of (e.g.
α =1%), we can reject the hypothesis that the default probability is not underestimated if: 1
Binom
(
D
kt
1 ,
N
kt
,
PD
kt
) where BINOM(x, N, q) denotes the binomial probability of observing x successes out of N trials with success probability q. If above condition is true, we need to assume an unlikely scenario to explain the actual default count D kt (or a higher one). This would lead us to conclude that the PD has underestimated the true default probability.
42
Datamining-Solutions
Normal test
For large N, the binomial distribution converges to the normal, so we can also use a normal approximation to equation from the previous slide.
If defaults follow a binomial distribution with default probability PD kt , the default count D kt has a standard deviation: The default count’s mean is:
PD
kt
( 1
PD
kt
)
N
kt
PD
kt
N
kt
Instead of equation using bonomial distribution we can now examine: 1 (
D
kt
0 .
5
PD
kt
( 1
PD PD
kt kt
)
N
kt
N
kt
) Where Φ denotes the cumulative standard normal distribution.
If above condition is true, we need to assume an unlikely scenario to explain the actual default count Dkt (or a higher one). This would lead us to conclude that the PD has underestimated the true default probability.
43
Datamining-Solutions
Normal test with asset correlation
When we can assume that defaults are not independent (so default correlation is not zero) we have to introduce a asset correlation ρ.
Now we examine the following equation using asset correlation ρ: 1 (
PD
kt
) 1 1 (
D
kt
/
N
kt
) Where 1 - is inverse of the normal cumulative distribution function.
If above equation is true, we conclude that the PD estimate was too low with the asset correlation ρ.
44
Datamining-Solutions
Normal test with asset correlation
Matlab file: Binomial.m
Call: input: [ALLTest]=Binomial(PD_est,PD,N,alpha,p) PD_est - Historically default rates e.g. for year 1990-2004, for every rating categories (grade) -The default probability of a rating category PD - probability of default of every grade rating N - amount of all trials in every grade rating alpha - significance level e.g. alpha=1% p - asset correlation e.g. p=0.07
Output: ALLTest – matrix of results first column- binomial second column – normal third column – normal with correlation p ------------------------------------------------------------------------------------------------------------ Matlab file data example: binDataExample.mat
45
Datamining-Solutions
Traffic lights approach
Decisions on significance levels are somewhat arbitrary. In a traffic lights approach, we choose two rather or more than one significance level. If the p-value of a test is below red, we assign an observation to the red zone, meaning that an underestimation of the default probability is very likely. If the p value is above red but below orange, we interpret the result as a very important warning that the PD might be an underestimate (orange zone). If the p-value is above orange but below yellow, we interpret the result as a warning that the PD might be an underestimate (yellow zone). Otherwise, we assign it to the green zone.
For example we assume the following significance level for trafficlight approach: red <=0.01 , orange (0.01,0.05>, yellow (0.05,0.07> , green >0.7
46
Datamining-Solutions
Normal test with asset correlation
Matlab file: TrafficLight.m
Call: input: [ALLTraficResult]=TrafficLight(PD_est,PD,N,p) PD_est - Historically default rates e.g. for year 1990-2004, for every rating categories (grade) -The default probability of a rating category PD - probability of default of every grade rating N - amount of all trials in every grade rating p - asset correlation e.g. p=0.07
In the file exists significance level for trafficlight: red <=0.01 , yellow (0.01,0.05>, orange (0.05,0.07> , green >0.7
Output: ALLTraficResult – matrix of results Number „4” denotes red light , Number „3” denotes yellow light, Number „1” denotes green light orange light, Number „2” denotes first column - binomial, second column – normal, third column – normal with correlation --------------------------------------------------------------------------------------------------- Matlab file data example: binDataExample.mat
47
Datamining-Solutions
Chi-square test (Hosmer-Lemeshow)
Let 0, , p … p K denote the forecasted default probabilities of debtors in the rating categories 0,1, …,k. Define the statistic
T k
i k
0 (
n i n i p i p i
( 1
i p i
) ) with ni = number of debtors with rating i and θi = number of defaulted debtors with rating i.
By the central limit theorem, when ni → ∞ simultaneously for all i, the distribution of Tk will converge in distribution towards a χ 2 k +1 -distribution if all the pi are the true default probabilities. The p value of a χ2 k +1 -test could serve as a measure of the accuracy of the estimated default probabilities: the closer the p-value is to zero, the worse the estimation is.
48
Datamining-Solutions
Chi-square test (Hosmer-Lemeshow)
Matlab file: Call: input: hosmer_lemeshow.m
p=hosmer_lemeshow(pd,is_default) pd – vector of estimated default from model is_default- vector of the real pd Output: The p value of a χ 2
k
+1
Datamining-Solutions
49