This is a brief non technical article to show how it’s possible to extract default probabilities of corporate and sovereign entities knowing only their Credit Default Swap quotes using the R package CreditRisk.
This example concerns counterparty credit risk. The context is that of interbank market in which bondholders (tipically banks) have large amount of risky bonds and look for nullify their losses due to potential corporate/sovereign default. For this purpose they ask for a kind of insurance realized by credit derivatives known as Credit Default Swap. Informally, the idea is that \(Risky Bond + CDS = Risk free Bond\), meaning that holding a bond and an insurance on its possible default equals holding the same bond but with no risk of losses.
The R package CreditRisk contains the Unicredit 6_Month-CDS quotes data of 2017-01-23 taken from Bloomberg:
library(CreditRisk)
cdsdata
## Maturity ED.Zero.Curve Par.spread
## 1 0.5 -0.0028 0.0063
## 2 1.0 -0.0024 0.0073
## 3 2.0 -0.0017 0.0091
## 4 3.0 -0.0008 0.0110
## 5 4.0 0.0002 0.0136
## 6 5.0 0.0014 0.0160
## 7 7.0 0.0039 0.0183
## 8 10.0 0.0076 0.0199
## 9 20.0 0.0137 0.0207
## 10 30.0 0.0146 0.0209
where Maturity is the CDS maturity expressed in years, Par.Spread is the CDS quote in the market (to be paid by protection buyer every 6 months in order to ensure the bond default; 0.0063 means that to ensure 1 euro in 6 M the bondholder has to pay 0.0063 euro, in this case only one time) and ED.Zero.Curve is the interest rate of a risk-free Bond (LIBOR rate).
Here in this example we are interested in finding the default probability of Unicredit bonds (i.e. the probability that Unicredit does not pay his obligations). To do this we use a method called calibration of the probabilities to the market quotes trough the CDS pricing model (recall that \(cds price = f(intensity;X)\)).
The calibration is an optimization method, the problem is solved minimizing the error between real market quotes and “model quotes from intensities”, which are theoretical, in order to find those intensities (think as istantanous probabilities) for which the error is near 0. Let’s use the function that perform the calibration to get our default intensities from Unicredit CDS market quotes:
cal_res = calibrate.cds(r = cdsdata$ED.Zero.Curve/100, t = seq(0.5, 30, by = 0.5),
T = cdsdata$Maturity, cdsrate = cdsdata$Par.spread)
cal_res
## $min_int
## [1] 0.01037878 0.01380405 0.01970238 0.02518586 0.04143480 0.04273286
## [7] 0.03724736 0.04678611 0.02243737 0.04866622
##
## $error
## [1] 1.833821e-08
These first ten values are the intensities we were looking for, i.e. those default probabilities corresponding to our CDS prices and the error is that occurred during the calibration. Now we use the intensities as input of cds function, a pricer for CDS, in order to get the default probabilities (this happens cause \(prob = f(intensity)\)):
tmp = cds2(t = seq(0.5, 30, by = 0.5), T = cdsdata$Maturity, tr = cdsdata$Maturity, r = cdsdata$ED.Zero.Curve/100, tint = cdsdata$Maturity, int = cal_res$min_int, R = 0.005, simplified = F, RR = 0.4
)
tmp
## T Survival PremiumLeg ProtectionLeg Rate Price
## 1 0.5 0.9948241 0.002480631 0.003105591 0.006259680 0.0006249601
## 2 1.0 0.9879814 0.004942100 0.007211264 0.007295749 0.0022691641
## 3 2.0 0.9701358 0.009794673 0.017918939 0.009147287 0.0081242652
## 4 3.0 0.9473050 0.014532859 0.031617851 0.010878056 0.0170849915
## 5 4.0 0.9125551 0.019100098 0.052467924 0.013734988 0.0333678262
## 6 5.0 0.8746643 0.023473216 0.075201572 0.016018592 0.0517283561
## 7 7.0 0.8085409 0.031711392 0.114869239 0.018111668 0.0831578470
## 8 10.0 0.7110882 0.042870665 0.173311560 0.020213305 0.1304408956
## 9 20.0 0.5061162 0.071850837 0.296113173 0.020606105 0.2242623360
## 10 30.0 0.3523733 0.093091214 0.388027852 0.020841272 0.2949366385
Note that timetables for interest rates, for intensities and for bond maturities could differ even if in this example we have chosen the same. Column Survival shows the survival probabilities of the different maturities (T) Unicredit Bonds:
This example used the data of one year ago. If you want to see what has changed in the Unicredit bond market, you can reproduce these passage using new cds quotes.
Altough we have used the simpler calibration method, other models calibration are available in the package, allowing you to calibrate probability to other parameters as interest rates or assets volatility. For details you can refer to the package documentation or, for more accuracy but in italian language to chapter 3.2, 3.3 and 4 of https://www.slideshare.net/slideshow/embed_code/key/LnKgEQbtraui3n
Every feedback on the package is welcome.