CreditProtectionPeriod#
- class rateslib.periods.CreditProtectionPeriod(*args, **kwargs)#
Bases:
BasePeriod
Create a credit protection period defined by a recovery rate.
- Parameters:
args (dict) – Required positional args to
BasePeriod
.recovery_rate (float, Dual, Dual2, optional) – The assumed recovery rate that defines payment on credit default. Set by
defaults
.kwargs (dict) – Required keyword arguments to
BasePeriod
.
Notes
The
cashflow
, paid on a credit event, is defined as follows;\[C = -N(1-R)\]where R is the recovery rate.
The
npv()
is defined as a discretized sum of inter-period blocks whose probability of default and protection payment sum to give an expected payment;\[\begin{split}j &= [n/discretization] \\ P &= C \sum_{i=1}^{j} \frac{1}{2} \left ( v(m_{i-1}) + v_(m_{i}) \right ) \left ( Q(m_{i-1}) - Q(m_{i}) \right ) \\\end{split}\]The start and end of the period are restricted by the Curve if the Period is current (i.e. today is later than start)
The
analytic_delta()
is defined as;\[A = 0\]Methods Summary
analytic_delta
([curve, disc_curve, fx, base])Return the analytic delta of the CreditProtectionPeriod.
analytic_rec_risk
([curve, disc_curve, fx, base])Calculate the exposure of the NPV to a change in recovery rate.
cashflow
(curve)float, Dual or Dual2 : The calculated protection amount determined from notional and recovery rate.
cashflows
([curve, disc_curve, fx, base])Return the cashflows of the CreditProtectionPeriod.
npv
([curve, disc_curve, fx, base, local])Return the NPV of the CreditProtectionPeriod.
Methods Documentation
- analytic_delta(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
Return the analytic delta of the CreditProtectionPeriod. See
BasePeriod.analytic_delta()
- analytic_rec_risk(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
Calculate the exposure of the NPV to a change in recovery rate.
For parameters see
BasePeriod.analytic_delta()
- Return type:
float
- cashflow(curve)#
float, Dual or Dual2 : The calculated protection amount determined from notional and recovery rate.
- cashflows(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
Return the cashflows of the CreditProtectionPeriod. See
BasePeriod.cashflows()
- npv(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False)#
Return the NPV of the CreditProtectionPeriod. See
BasePeriod.npv()