Skip to main content

Module credit

Module credit 

Expand description

Portfolio credit loss models: the one-factor Gaussian and double-t copulas (Copula) and the large-homogeneous-pool (LHP) expected tranche loss. The formulas below are the Gaussian’s; the double-t replaces Φ by the unit-variance t CDFs of the factor and the names, and Φ⁻¹ by the inverse of the latent variable’s CDF, a convolution computed by quadrature.

Xᵢ = √ρ·M + √(1−ρ)·εᵢ           default ⇔ Xᵢ < C = Φ⁻¹(PD(t))
p(t|m) = Φ((C − √ρ·m)/√(1−ρ))    conditional default probability
L(t|m) = LGD · p(t|m)            LHP pool loss fraction
ETL(t; A, D) = ∫ min(max(L(t|m) − A, 0), D − A) φ(m) dm

Everything is computed in the mode over a fixed factor quadrature grid, so a reverse pass yields the sensitivities of an expected tranche loss to every survival pillar it read. The normal functions are written in the mode too — West’s CDF is polynomial and exponential arithmetic — rather than linearised at a passive point, so every order of derivative is the function’s own.

Structs§

DoubleT 🔒
The double-t copula’s two unit-variance t distributions.
NuLifts 🔒
The two distributions’ ν-lifts, built only when the degrees of freedom are marked.

Enums§

Copula
The one-factor copula a portfolio credit product prices under: how the names’ latent variables Xᵢ = √ρ·M + √(1−ρ)·Zᵢ are distributed.
Panel 🔒
A piece of the factor line the double-t integrates over.
RecoveryModel
How a tranche’s pool recovers from a default under the one-factor Gaussian copula.

Constants§

BULK 🔒
The first rung of the geometric ladder past the bulk.
CUTS 🔒
Where a window about a centre is cut, in its scale: the factor’s bulk about zero at scale one, a name’s transition about C/√ρ at √(1−ρ)/√ρ.
FACTOR_BOUND 🔒
Integration bound: |m| ≤ 8 captures the normal density to ~1e-15.
FACTOR_NODES 🔒
Quadrature order for the common-factor integral.
PANEL_NODES 🔒
Gauss–Legendre order on each panel of the double-t’s factor integral.
SQRT_2PI 🔒

Functions§

amraoui_hitier_marginal 🔒
The Amraoui–Hitier conditional loss as the constant-recovery LHP’s: (1 − R̃)·Φ((Φ⁻¹(pd') − √ρ·m)/√(1 − ρ)) is the loss of a pool with default probability pd' = pd·(1 − R̄)/(1 − R̃) and loss given default 1 − R̃. Generic in the floor so its sensitivities read in the mode.
basket_survival_marked 🔒
basket_survival_probability with the double-t’s degrees of freedom lifted by marks: the thresholds, the names’ conditional probabilities and the factor’s weights carry their ν-derivatives, the value unmarked. marks is ignored under the Gaussian.
basket_survival_probability
P(fewer than n defaults by t) for a finite basket under a one-factor copula: at each factor node the constituents’ conditional default probabilities feed a Poisson-binomial recursion truncated at n, and the lower tail integrates over the factor. Heterogeneous marginals are the point — each pd is typically read off its own survival curve.
basket_tail 🔒
Σ wᵢ·P(N < n | mᵢ) over a factor grid, the conditional count distribution by the Poisson-binomial recursion truncated at n.
capped_loss 🔒
The LHP expected capped loss E[min(L, K)], L = lgd·p(M).
conditional 🔒
The conditional default probability at factor m.
expected_tranche_loss
The LHP expected tranche loss E[min(max(L − A, 0), D − A)] as a pool-loss fraction, for unconditional default probability pd, loss given default lgd and asset correlation rho, under copula. Zero when pd ≤ 0.
expected_tranche_loss_marked 🔒
expected_tranche_loss with the double-t’s degrees of freedom lifted by marks: the value is the unmarked one, the ν-derivatives the model’s. marks is ignored under the Gaussian.
factor_grid
The factor grid, (m, w·φ(m)) pairs: Σ wᵢ·f(mᵢ) ≈ ∫ f(m)·φ(m) dm.
finite_pool_tranche_loss
The expected tranche loss E[min(max(L − A, 0), D − A)] of a finite homogeneous pool of names identical names under the Gaussian copula, as a pool-loss fraction: at each factor node the number of defaults is binomial on the conditional default probability, the tranche loss is its expectation over that distribution — each name losing lgd / names — and the factor integrates on the same grid as the large pool. This is exact for a homogeneous pool, and the large pool is its limit.
gauss_hermite 🔒
Gauss–Hermite nodes and weights for a standard normal: Σ wᵢ·f(xᵢ) ≈ E[f(Z)], the weights summing to one. The roots of the physicists’ Hermite polynomial by Newton iteration on its orthonormal recurrence, seeded from the largest root inward, then rescaled to the normal density.
gauss_legendre 🔒
Gauss–Legendre nodes and weights on [−1, 1] by Newton iteration on the Legendre recurrence.
inv_norm_cdf
The inverse standard-normal CDF: Acklam’s approximation at the passive value, then the inverse’s Taylor series about it written in the mode, to third order in u = (p − Φ(x₀))/φ(x₀):
inv_norm_cdf_f64 🔒
Acklam’s rational approximation of Φ⁻¹, passive; polished by inv_norm_cdf.
loadings 🔒
(√ρ, √(1 − ρ)), checked against [0, 1).
norm_cdf
The standard-normal CDF by West’s double-precision algorithm, in the mode.
panel_rule 🔒
Gauss–Legendre nodes and weights on [−1, 1] for one panel.
tail_scale 🔒
The tail map’s scale from a start point a: the distance to the origin, so the map’s first nodes sit at the start’s own scale.
to_f64 🔒
A small count as a float — exact for every grid size in play.
unit_grid 🔒
Gauss–Legendre nodes and weights on [−1, 1] for the smooth piece of the capped loss.

Type Aliases§

DofMarks 🔒
A double-t copula’s degrees of freedom as market inputs: the moves (Δν_factor, Δν_idiosyncratic) off the passive point the Copula::StudentT states, each zero-valued and carrying the lifted mark’s derivatives.