cds {CreditRisk} | R Documentation |
Calculates Credit Default Swap rates
Description
Calculates CDS rates starting form default intensities.
Usage
cds(t, int, r, R = 0.005, RR = 0.4, simplified = FALSE)
Arguments
t |
premium timetable. |
int |
deterministic default intensities vector. |
r |
spot interest rates. |
R |
constant premium payments, value that the buyer pays in each |
RR |
recovery rate on the underline bond, default value is 40%. |
simplified |
logic argument. If FALSE calculates the CDS rates using the semplified version of calculations, if TRUE use the complete version. |
Details
Premium timetable is
. The vector starts from
, i.e. the first premium is payed at a year fraction in the possibility that the bond is not yet defaulted. Since premium are a postponed payment (unlike usual insurance contracts).
Intensities timetable have domains
.
spot interest rates of bond have domain
. The function transforms spot rates in forward rates. If we specify that we want to calculate CDS rates with the simplified alghoritm, in each period, the amount of the constant premium payment is expressed by:
and the amount of protection, assuming a recovery rate
, is:
If we want to calculate same quantities with the complete version, that evaluate premium in the continous, the value of the premium leg is calculated as:
and the protection leg as:
In both versions the forward rates and intensities are supposed as costant stepwise functions with discontinuity in
Value
cds
returns an object of class data.frame
with columns, for esch date
the value of survival probability, the premium and protection leg, CDS rate
and CDS price.
References
David Lando (2004) Credit risk modeling.
Damiano Brigo, Massimo Morini, Andrea Pallavicini (2013) Counterparty Credit Risk, Collateral and Funding. With Pricing Cases for All Asset Classes
Examples
cds(t = seq(0.5, 10, by = 0.5), int = seq(.01, 0.05, len = 20),
r = seq(0,0.02, len=20), R = 0.005, RR = 0.4, simplified = FALSE)