(五十三)Credit VaR的计算

Credit VaR计算方法

  Credit VaR在信用风险管理中又称Unexpected Loss,即UL=WCL-EL,该计算中主要针对UL进行展开,即利用二项分布的思想,在给定的置信水平下计算出发生违约的总个数,计算出WCL、EL,最后计算出UL。

  Expected Loss (EL):Expected value of credit loss, and represents the portion of loss a creditor should provision for. If the only possible credit event is default, expected loss is equal to: EL = PD×(1-Recovery Rate)×EAD = PD×LGD×EAD.

  Unexpected Loss (Credit VaR):Is typically defined in terms of unexpected loss (UL) as the worst-case portfolio loss at a given confidence level over a specific holding period, minus the expected loss:UL = Credit VaR = WCL-EL.

在这里插入图片描述

案例

  Consider a portfolio of $100 million with 3 bonds A, B,and C, with various probabilities of default, calculate the 95% Credit VaR.
在这里插入图片描述
  step1:罗列出各种损失的可能性并计算损失额。由于一个组合可能有很多资产,我们用一种一般化的方法列出组合资产集合的所有子集,此案例中即求(A,B,C)的所有子集:

#位图法求集合的所有子集
def Sets(items):
    subset=[]
    N=len(items)
    for i in range(2**N):#子集个数,每循环一次一个子集
        combo=[]
        for j in range(N):#用来判断二进制下标为j的位置数是否为1
            if(i>>j)%2:
                combo.append(items[j])
        subset.append(combo)
    return(subset)
defaults=Sets(['A','B','C'])
defaults
Out[2]: [[], ['A'], ['B'], ['A', 'B'], ['C'], ['A', 'C'], ['B', 'C'], ['A', 'B', 'C']]

df=pd.DataFrame({'issuer':['A','B','C'],'exposure':[25,30,45],'p':[0.05,0.1,0.2]})
df
Out[3]: 
  issuer  exposure     p
0      A        25  0.05
1      B        30  0.10
2      C        45  0.20

#计算loss并且按照由小到大排序
table=pd.DataFrame({'defaults':defaults,'loss':np.zeros(len(defaults)),\
'prob':np.zeros(len(defaults)),'cum prob':np.zeros(len(defaults))})
for i in defaults:
    index=defaults.index(i)
    table.iloc[index,1]=df['issuer'].map(lambda x: (df['exposure'][df['issuer']==x]).values if x in i else 0).sum()
table=table.sort_values(by="loss",ascending=True).reset_index(drop=True)
table
Out[12]: 
    defaults   loss  prob  cum prob
0         []    0.0   0.0       0.0
1        [A]   25.0   0.0       0.0
2        [B]   30.0   0.0       0.0
3        [C]   45.0   0.0       0.0
4     [A, B]   55.0   0.0       0.0
5     [A, C]   70.0   0.0       0.0
6     [B, C]   75.0   0.0       0.0
7  [A, B, C]  100.0   0.0       0.0

  step2:计算每一种损失情况下的概率和累计概率,以及EL:

for i in table['defaults']:
    index=list(table['defaults']).index(i)
    b=df['issuer'].map(lambda x: (df['p'][df['issuer']==x]).values if x in i else 1).prod()
    c=df['issuer'].map(lambda x: 1-(df['p'][df['issuer']==x]).values if x not in i else 1).prod()
    table.iloc[index,2]=b*c
table.iloc[:,3]=table.iloc[:,2].cumsum()
table
Out[15]: 
    defaults   loss   prob  cum prob
0         []    0.0  0.684     0.684
1        [A]   25.0  0.036     0.720
2        [B]   30.0  0.076     0.796
3        [C]   45.0  0.171     0.967
4     [A, B]   55.0  0.004     0.971
5     [A, C]   70.0  0.009     0.980
6     [B, C]   75.0  0.019     0.999
7  [A, B, C]  100.0  0.001     1.000
EL=sum(df['exposure']*df['p'])
EL
Out[20]: 13.25

  step3:由上表可知95%的置信水平下对应的WCL=45,UL=WCL-EL=45-13.25=31.75,即Credit VaR为31.75m。此方法对于假设资产之间违约不相关的组合Credit VaR的计算非常方便,如果考虑了相关性那么就需要用Copula等更复杂的方法来计算。

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值