cds fixed recovery
financepy.products.credit.cds_fixed_recovery
Class
CDSFixedRecovery
CDSFixedRecovery(
step_in_dt: Date,
maturity_dt_or_tenor: Date | str,
running_cpn: float,
fixed_recovery: float,
notional: float = 1000000,
long_protect: bool = True,
freq_type: FrequencyTypes = <FrequencyTypes.QUARTERLY: 4>,
accrual_dc_type: DayCountTypes = <DayCountTypes.ACT_360: 8>,
cal_type: CalendarTypes | list | tuple = <CalendarTypes.WEEKEND: 2>,
bd_type: BusDayAdjustTypes = <BusDayAdjustTypes.FOLLOWING: 2>,
dg_type: DateGenRuleTypes = <DateGenRuleTypes.BACKWARD: 2>,
)
Inherits from: CDS
Fixed-recovery credit default swap.
Methods
prot_leg_pv
prot_leg_pv(
self,
value_dt: Date,
issuer_curve: CDSCurve,
recovery_rate: float = None,
num_steps_per_year: int = 25,
prot_method = 0,
)
No description available.
value
value(
self,
value_dt: Date,
issuer_curve: CDSCurve,
recovery_rate: float = None,
pv01_method = 0,
prot_method = 0,
num_steps_per_year: int = 25,
)
No description available.
recovery_dv01
recovery_dv01(
self,
value_dt: Date,
issuer_curve: CDSCurve,
pv01_method: int = 0,
prot_method: int = 0,
num_steps_per_year: int = 25,
)
PV change for a 1% increase in the issuer curve recovery assumption.
The contractual fixed recovery, market CDS quotes, and discount
curve are held unchanged.
Returns:
PV(curve recovery + 0.01, fixed recovery)
- PV(curve recovery, fixed recovery)
value_fast_approx
value_fast_approx(
self,
value_dt: Date,
flat_cont_interest_rate: float,
flat_cds_curve_spread,
curve_recovery: float = 0.4,
bump_size: float = 0.0001,
recovery_bump_size: float = 0.01,
)
Fast approximate CDS valuation using flat hazard and discount curves.
The hazard rate is implied from the flat CDS spread via the credit
triangle ``h = spread / (1 - curve_recovery)`` and both survival
and discounting are treated as flat exponentials. The premium leg
ignores the actual coupon schedule; accrual-on-default is captured
only heuristically through the 365/360 clean-RPV01 adjustment. All
PVs are in currency units of the contract notional.
Args:
value_dt: Valuation date (a ``Date``). Scalar only.
flat_cont_interest_rate: Flat continuously compounded discount
rate. Scalar or array-like.
flat_cds_curve_spread: Flat CDS par spread (decimal, e.g. 0.01
for 100 bp). Must be non-negative. Scalar or array-like.
curve_recovery: Recovery rate used to imply the hazard rate
from the spread. Must lie in ``[0, 1)``. Scalar or
array-like.
contract_recovery_rate: Contractual recovery rate used on the
protection leg. Must lie in ``[0, 1]``. Scalar or
array-like.
bump_size: Absolute bump applied to the spread and to the
interest rate for the finite-difference sensitivities.
Scalar or array-like, strictly positive.
recovery_bump_size: Absolute bump applied to the contractual
recovery rate for the recovery sensitivity. Scalar or
array-like, strictly positive.
Returns:
A tuple ``(full_pv, clean_pv, spread_dv01, ir_dv01, recovery01)``:
full_pv: Clean PV plus accrued interest.
clean_pv: PV excluding accrued interest.
credit01: PV change for a 1 bp increase in the CDS spread.
ir01: PV change for a 1 bp increase in the interest rate.
recovery01: PV change for a 1 percentage-point increase in
the contractual recovery.
Elements are floats if every input was scalar, otherwise ndarrays
with the broadcast shape of the inputs. The sensitivities are
one-sided (upward) finite differences, rescaled to the stated
units whatever bump sizes are supplied. Recovery01 bumps the
recovery assumption everywhere it enters: the hazard rate is
re-implied from the unchanged quoted spread under the bumped
curve recovery, and the contractual loss uses the bumped
contract recovery. It is therefore small and vanishes for an
at-market contract.
Raises:
FinError: If any input is invalid, the inputs cannot be
broadcast together, or the contract has matured.
Generated automatically from the FinancePy source code.
Do not edit this file manually.