abaquant.credit.cds¶
Import path: abaquant.credit.cds
Domain: Credit-risk analytics and fundamentals-derived credit proxies.
Purpose¶
Credit-default-swap valuation primitives.
When to use it¶
Use this package for transition matrices, spread-based valuation, CDS/CDO building blocks, copula simulation, tail risk, and accounting-based credit diagnostics.
Public objects¶
function:
cds_probability_table— Build the default and survival probability table used for CDS valuation.function:
cds_premium_leg_table— Build the discounted premium-leg cash-flow table for a CDS.function:
cds_contingent_leg_table— Build the discounted contingent-protection-leg cash-flow table for a CDS.function:
cds_accrued_premium_table— Build the accrued-premium approximation table for a CDS.function:
cds_fair_spread— Compute the fair annual CDS premium rate from leg present values.function:
value_cds— Value the CDS premium and protection legs and compute the fair spread.
Detailed reference¶
Credit-default-swap valuation primitives.
Purpose¶
The module constructs probability, premium-leg, contingent-leg, and accrued-premium tables and computes a fair CDS spread.
Conventions¶
Hazard and discount rates are decimal annual rates; maturity is in years; recovery is a fraction in [0, 1].
References
[ 1 ] Jarrow, R. A., and S. M. Turnbull (1995), “Pricing Derivatives on Financial Securities Subject to Credit Risk”.
Build the accrued-premium approximation table for a CDS.
- Parameters:
hazard_rate (float) – Constant default intensity in decimal annual units.
discount_rate (float) – Annual discount rate in decimal units.
maturity (int) – Time to option expiry in years.
- Returns:
Tabular result with the index, column schema, units, and missing-value treatment defined by the module convention.
- Return type:
pandas.DataFrame
- abaquant.credit.cds.cds_contingent_leg_table(hazard_rate, discount_rate, maturity, recovery_rate)¶
Build the discounted contingent-protection-leg cash-flow table for a CDS.
- Parameters:
hazard_rate (float) – Constant default intensity in decimal annual units.
discount_rate (float) – Annual discount rate in decimal units.
maturity (int) – Time to option expiry in years.
recovery_rate (float) – Recovery fraction expressed as a decimal in [0, 1].
- Returns:
Tabular result with the index, column schema, units, and missing-value treatment defined by the module convention.
- Return type:
pandas.DataFrame
- abaquant.credit.cds.cds_fair_spread(vpc_total, vppp_total, vpv_total)¶
Compute the fair annual CDS premium rate from leg present values.
- Parameters:
vpc_total (float) – Total present value of the CDS contingent leg.
vppp_total (float) – Total present value of the CDS premium-payment leg.
vpv_total (float) – Total present value of accrued CDS premium.
- Returns:
Computed cds fair spread as a dimensionless decimal quantity.
- Return type:
float
Build the discounted premium-leg cash-flow table for a CDS.
- Parameters:
hazard_rate (float) – Constant default intensity in decimal annual units.
discount_rate (float) – Annual discount rate in decimal units.
maturity (int) – Time to option expiry in years.
- Returns:
Tabular result with the index, column schema, units, and missing-value treatment defined by the module convention.
- Return type:
pandas.DataFrame
- abaquant.credit.cds.cds_probability_table(hazard_rate, maturity)¶
Build the default and survival probability table used for CDS valuation.
- Parameters:
hazard_rate (float) – Constant default intensity in decimal annual units.
maturity (int) – Time to option expiry in years.
- Returns:
Tabular result with the index, column schema, units, and missing-value treatment defined by the module convention.
- Return type:
pandas.DataFrame
- abaquant.credit.cds.value_cds(hazard_rate, discount_rate, maturity, recovery_rate)¶
Value the CDS premium and protection legs and compute the fair spread.
- Parameters:
hazard_rate (float) – Constant default intensity in decimal annual units.
discount_rate (float) – Annual discount rate in decimal units.
maturity (int) – Time to option expiry in years.
recovery_rate (float) – Recovery fraction expressed as a decimal in [0, 1].
- Returns:
Dictionary of named model outputs, metrics, or workflow results defined by the current public schema.
- Return type:
dict[str, object]