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 atsinside a period, with the gap read at its endt, isE[D_t·λ_s·S_s·g(x_t)]: under the measure that discounts totand survives tosthe factor’s mean moves by−Cov(x_t, ∫₀ˢy), and Stein’s lemma turnsE[λ_s·g(x_t)]intoλ̄_s·E[g] + Cov(x_t, y_s)·E[g′](seeDefaultTimeMoments). The period’s market default mass is charged ats = texactly, and what the covariances add across the period by three-point Gauss–Legendre. Atρ = 0every 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§
- Claim
Terms 🔒 - 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, theN_fbeing what the floating leg’s index part with its final notional is worth at a reset. - Default
Time 🔒Moments - The rate–credit moments for default at
swith the gap read att ≥ s, eachCov(x_s, ·)carried totalong the factor’s mean reversion. Withc₁ = Cov(x_s, ∫₀ˢy),c₂ = Cov(x_s, y_s)andB = 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)duandCov(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 callg(x) = (Σ c_j·P(t,u_j|x) − K)⁺on a Gaussian factorx ~ N(mean, var), undiscounted att.- phi1 🔒
φ(k, x) = (1 − e^{−k·x}) / k, by its series where|k·x| < 0.5.- repack_
gap - The repack gap charge of
noteagainstview, under the note’s engine.
Type Aliases§
- Flow 🔒
- One flow of the claim bond: the date it pays and its amount, in the mode.