CreditPremiumPeriod#

class rateslib.periods.CreditPremiumPeriod(*args, fixed_rate=NoInput.blank, premium_accrued=NoInput.blank, **kwargs)#

Bases: BasePeriod

Create a credit premium period defined by a credit spread.

Parameters:
  • args (dict) – Required positional args to BasePeriod.

  • fixed_rate (float or None, optional) – The rate applied to determine the cashflow. If None, can be set later, typically after a mid-market rate for all periods has been calculated. Entered in percentage points, e.g 50bps is 0.50.

  • premium_accrued (bool, optional) – Whether the premium is accrued within the period to default.

  • kwargs (dict) – Required keyword arguments to BasePeriod.

Notes

The cashflow is defined as follows;

\[C = -NdS\]

The NPV of the full cashflow is defined as;

\[P_c = Cv(m_{payment})Q(m_{end})\]

If premium_accrued is permitted then an additional component equivalent to the following is calculated using an approximation of the inter-period default rate,

\[P_a = Cv(m_{payment}) \left ( Q(m_{start}) - Q(m_{end}) \right ) \frac{(n+r)}{2n}\]

where r is the number of days after the start that today is for an on-going period, zero otherwise, and \(Q(m_{start})\) is equal to one for an on-going period.

The npv() is defined as;

\[P = P_c + I_{pa} P_a\]

where \(I_{pa}\) is an indicator function if the Period allows premium_accrued or not.

The analytic_delta() is defined as;

\[A = - \frac{\partial P}{\partial S} = Ndv(m) \left ( Q(m_{end}) + I_{pa} (Q(m_{start}) - Q(m_{end}) \frac{(n+r)}{2n} \right )\]

Attributes Summary

cashflow

The calculated value from rate, dcf and notional.

Methods Summary

accrued(settlement)

Calculate the amount of premium accrued until a specific date within the Period.

analytic_delta([curve, disc_curve, fx, base])

Return the analytic delta of the CreditPremiumPeriod.

cashflows([curve, disc_curve, fx, base])

Return the cashflows of the CreditPremiumPeriod.

npv([curve, disc_curve, fx, base, local])

Return the NPV of the CreditPremiumPeriod.

Attributes Documentation

cashflow#

The calculated value from rate, dcf and notional.

Type:

float, Dual or Dual2

Methods Documentation

accrued(settlement)#

Calculate the amount of premium accrued until a specific date within the Period.

Parameters:

settlement (datetime) – The date against which accrued is measured.

Return type:

float

analytic_delta(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#

Return the analytic delta of the CreditPremiumPeriod. See BasePeriod.analytic_delta()

cashflows(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#

Return the cashflows of the CreditPremiumPeriod. See BasePeriod.cashflows()

npv(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False)#

Return the NPV of the CreditPremiumPeriod. See BasePeriod.npv()