abaquant.credit.cdo¶
Import path: abaquant.credit.cdo
Domain: Credit-risk analytics and fundamentals-derived credit proxies.
Purpose¶
One-factor Gaussian-copula CDO tranche valuation.
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:
gauss_hermite_normal— Transform Gauss–Hermite nodes to standard-normal factor nodes.function:
log_binomial_coefficient— Compute the logarithm of a binomial coefficient.function:
conditional_default_probability— Compute conditional default probability given the common Gaussian factor.function:
binomial_probabilities_log— Compute binomial probabilities in log-stable form.function:
expected_tranche_survival_given_factor— Compute conditional expected tranche survival for one factor realization.function:
value_tranche— Value the tranche cash-flow structure under the one-factor Gaussian-copula model.
Detailed reference¶
One-factor Gaussian-copula CDO tranche valuation.
Purpose¶
The module evaluates conditional default probabilities and expected tranche survival under a one-factor Gaussian copula.
Conventions¶
Hazard rates and risk-free rates are decimal annual rates. Attachment and detachment are fractional portfolio-loss points. Recovery is a fraction in [0, 1].
References
[ 1 ] Li, D. X. (2000), “On Default Correlation: A Copula Function Approach”. [ 2 ] Jarrow, R. A., and S. M. Turnbull (1995), “Pricing Derivatives on Financial Securities Subject to Credit Risk”.
- abaquant.credit.cdo.binomial_probabilities_log(n, q, k_max)¶
Compute binomial probabilities in log-stable form.
- Parameters:
n (int) – Number of discrete periods, assets, or observations as determined by the callable.
q (np.ndarray) – Continuous dividend or carry yield in decimal annual units.
k_max (int) – Largest event-count index retained in the binomial probability vector.
- Returns:
Numeric array ordered consistently with the supplied strikes, time grid, assets, or state labels.
- Return type:
numpy.ndarray
- abaquant.credit.cdo.conditional_default_probability(t, hazard_rate, rho, factor)¶
Compute conditional default probability given the common Gaussian factor.
- Parameters:
t (float) – Time in years at which a credit-model quantity is evaluated.
hazard_rate (float) – Constant default intensity in decimal annual units.
rho (float) – Correlation parameter constrained to the interval [-1, 1].
factor (np.ndarray) – Common-factor realization in the one-factor Gaussian copula.
- Returns:
Result of the conditional default probability calculation.
- Return type:
np.ndarray
- abaquant.credit.cdo.expected_tranche_survival_given_factor(t, hazard_rate, rho, n, recovery_rate, attachment, detachment, factor_nodes)¶
Compute conditional expected tranche survival for one factor realization.
- Parameters:
t (float) – Time in years at which a credit-model quantity is evaluated.
hazard_rate (float) – Constant default intensity in decimal annual units.
rho (float) – Correlation parameter constrained to the interval [-1, 1].
n (int) – Number of discrete periods, assets, or observations as determined by the callable.
recovery_rate (float) – Recovery fraction expressed as a decimal in [0, 1].
attachment (float) – Tranche attachment point as a fractional portfolio loss.
detachment (float) – Tranche detachment point as a fractional portfolio loss.
factor_nodes (np.ndarray) – Quadrature nodes representing the common Gaussian factor.
- Returns:
Result of the expected tranche survival given factor calculation.
- Return type:
np.ndarray
- abaquant.credit.cdo.gauss_hermite_normal(nodes)¶
Transform Gauss–Hermite nodes to standard-normal factor nodes.
- Parameters:
nodes (int) – Quadrature nodes or numerical nodes accepted by the routine.
- Returns:
Numeric array ordered consistently with the supplied strikes, time grid, assets, or state labels.
- Return type:
numpy.ndarray
- abaquant.credit.cdo.log_binomial_coefficient(n, k)¶
Compute the logarithm of a binomial coefficient.
- Parameters:
n (int) – Number of discrete periods, assets, or observations as determined by the callable.
k (int) – Integer count used in the binomial coefficient.
- Returns:
Computed log binomial coefficient as a scalar in the units implied by the input values.
- Return type:
float
- abaquant.credit.cdo.value_tranche(hazard_rate, rho, n, recovery_rate, attachment, detachment, risk_free_rate, periods, factor_nodes, weights)¶
Value the tranche cash-flow structure under the one-factor Gaussian-copula model.
- Parameters:
hazard_rate (float) – Constant default intensity in decimal annual units.
rho (float) – Correlation parameter constrained to the interval [-1, 1].
n (int) – Number of discrete periods, assets, or observations as determined by the callable.
recovery_rate (float) – Recovery fraction expressed as a decimal in [0, 1].
attachment (float) – Tranche attachment point as a fractional portfolio loss.
detachment (float) – Tranche detachment point as a fractional portfolio loss.
risk_free_rate (float) – Annual risk-free rate in decimal units.
periods (list[float] | tuple[float, ...] | np.ndarray) – Number of discrete compounding or payment periods.
factor_nodes (np.ndarray) – Quadrature nodes representing the common Gaussian factor.
weights (np.ndarray) – Portfolio weights, either a mapping keyed by asset or an ordered numeric vector as documented by the callable.
- Returns:
Named outputs of the value tranche calculation.
- Return type:
dict[str, float | np.ndarray]