Skip to main content

Module repack_gap

Module repack_gap 

Expand description

The repack gap charge, in closed form.

On the issuer’s default the SPV holds the collateral’s recovery R·N and owes the bank its swap’s close-out value. Default is placed at the end of each floating period still to come, where the bank’s remaining claim is an exact riskless coupon bond in the Hull-White state: the collateral’s coupons and redemption, less the spread and the deterministic projection basis on every later floating period — the swap’s own projected coupon over the discount curve’s forward on its accrual. The bank pays the floating leg, whose index part with its final notional is worth exactly N_f at a reset, so the swap is worth the claim bond less N_f to the bank, and the gap is that bond over N_f + R·N, where positive — a call on the claim bond.

  • Independent: default timing does not depend on rates, so the charge is Σ p_i · P(0,t_i)·E^{t_i}[g_i], a strip of Jamshidian bond calls weighted by the default probability over each period.
  • Correlated: a Gaussian intensity λ = y + ψ(t), dy = −b·y dt + η dW, correlated ρ with the Hull-White factor, ψ matching the market’s risky discount factors. Default at s inside a period, with the gap read at its end t, is E[D_t·λ_s·S_s·g(x_t)]: under the measure that discounts to t and survives to s the factor’s mean moves by −Cov(x_t, ∫₀ˢy), and Stein’s lemma turns E[λ_s·g(x_t)] into λ̄_s·E[g] + Cov(x_t, y_s)·E[g′] (see DefaultTimeMoments). The period’s market default mass is charged at s = t exactly, and what the covariances add across the period by three-point Gauss–Legendre. At ρ = 0 every cross term vanishes and the charge is the independent one exactly.

The claim bond’s state is the Hull-White factor x_t (zero mean under the risk-neutral measure), in which P(t,u|x) = P(0,u)/P(0,t) · exp(−B·C(t) − ½B²·V(0,t) − B·x).

Structs§

ClaimTerms 🔒
The bank’s claim on the SPV as a riskless coupon bond, per default date: the collateral’s flows after the date, less the spread and today’s projection basis on every floating coupon starting at or after it; struck at N_f + R·N, the N_f being what the floating leg’s index part with its final notional is worth at a reset.
DefaultTimeMoments 🔒
The rate–credit moments for default at s with the gap read at t ≥ s, each Cov(x_s, ·) carried to t along the factor’s mean reversion. With c₁ = Cov(x_s, ∫₀ˢy), c₂ = Cov(x_s, y_s) and B = B_a(s, t):
GapCharge
The repack gap charge and its rows, in the pricing mode.
GapRow
One default date’s share of the gap charge.

Constants§

GAUSS_LEGENDRE_3 🔒
Three-point Gauss–Legendre on [−1, 1]: (node, weight).

Functions§

cross_moments 🔒
The two rate–credit cross moments at t, per volatility piece: Cov(x_t, ∫₀ᵗy) = ρη ∫σ(u)e^{−a(t−u)}B_b(u,t)du and Cov(x_t, y_t) = ρη ∫σ(u)e^{−(a+b)(t−u)}du. Linear in σ: these are covariances between two factors, not a variance.
exp_integral 🔒
∫_{v1}^{v2} e^{−k·v} dv = e^{−k·v1}·φ(k, v2 − v1).
gaussian_bond_call 🔒
(E[g], E[g′]) for the call g(x) = (Σ c_j·P(t,u_j|x) − K)⁺ on a Gaussian factor x ~ N(mean, var), undiscounted at t.
phi1 🔒
φ(k, x) = (1 − e^{−k·x}) / k, by its series where |k·x| < 0.5.
repack_gap
The repack gap charge of note against view, under the note’s engine.

Type Aliases§

Flow 🔒
One flow of the claim bond: the date it pays and its amount, in the mode.