Module short_rate
Expand description
The one-factor Hull-White short-rate engine.
dr = (theta(t) − a·r) dt + sigma dW. The term structure enters through
theta, which is why nothing here re-derives it: the engine reads today’s
discount curve live and the drift is implied by it.
Structs§
- Hull
White - A validated one-factor Hull-White model, passive.
- Solved
Parameter - A parameter recovered by a passive solve, with the derivative its calibration condition implies.
Functions§
- coupon_
bond_ option - The price of a European option on a coupon bond, by Jamshidian’s
decomposition, in mode
R, with the strike paid on the expiry itself. - coupon_
bond_ 🔒option_ from - A European option, exercised at
expiry, to exchangestrikepaid onstartfor the coupon bondΣ c_ipaid onpay_dates— Jamshidian’s decomposition in modeR, with the strike leg forward-starting as a swaption’s is: the swap delivered at expiry starts a spot lag later. - discount_
bond_ affine - The affine factors of the model’s discount bond seen from
t:P(t, T; r) = A(t, T) · e^{−B(t, T)·r}, withB = (1 − e^{−a(T−t)}) / aandA = P(0,T)/P(0,t) · exp(B·f(0,t) − σ²(1 − e^{−2at}) B² / 4a). - forward_
bond_ 🔒option_ at - An option at
ton the forward bondP(·, u)/P(·, s), struck atstrikeand paid in units of the bond maturing ats: the zero-bond formula withP(0, s)forP(0, t)and volatilityσ_p(t, u) − σ_p(t, s). Ats = tit iszero_bond_option_at, term for term. - hull_
white_ compounded_ convexity_ exponent - The exponent
Λof the Hull–White futures convexity for an overnight rate compounded in arrears fromstarttoend(years from today,startthe first instant not yet fixed): under the modelE[exp ∫ₛᴱ r] = P(0, s)/P(0, E) · e^Λ(Mercurio 2018), with - hull_
white_ convexity_ bias - The Hull–White convexity bias of a futures quote: the futures rate less
the forward rate for a contract whose term rate fixes at
tand runs tomaturity(years from today), atfutures_price(100 − 100 · rate) — the Hull-White convexity bias, the rates simple overT − t:1 + τF_fut = (1 + τF_fwd)·e^Λ,Λbyhull_white_convexity_exponent. - hull_
white_ convexity_ exponent - The exponent
Λof the Hull–White futures convexity for a term rate fixing attand running tomaturity(years from today): under the modelE[1/P(t, T)] = P(0, t)/P(0, T) · e^Λ, with - in_
period_ 🔒variance ∫₀^τ B(θ)² dθ,B(θ) = (1 − e^{−aθ})/a: the variance per unitσ²an in-arrears period accrues while it fixes.- instantaneous_
forward - The instantaneous forward
f(0, date)offcurve, in the mode: a forward difference of−ln P(0, ·)over the one day fromdate— the same stencil the lattice fit uses for its terminal displacement, so the two agree on the number. - payer_
swaption - A European payer swaption under Hull-White: the par-struck put on the
coupon bond paying
fixed_rate·τ_ionpay_datesplus redemption, per unit notional.accrualsare the fixed-period year fractions. - phi1 🔒
φ(a, x) = (1 − e^{−a·x}) / a, the duration factor over a spanx, summed as its seriesx·Σ (−ax)^k/(k+1)!where|a·x| < 0.5so it tends toxasa → 0without cancellation. In the mode.- reattach
- Reattaches a passively-solved parameter to the pricing mode.
- receiver_
swaption - A European receiver swaption under Hull-White: the par-struck call on
the same coupon bond as
payer_swaption. - sigma_
from_ price - The Hull-White
sigmaimplyingtarget_pricefor a zero-bond option. - swap_
coupons 🔒 - The fixed leg’s flows per unit notional with the redemption on the last.
- swaption_
from 🔒 - A European swaption under Hull-White whose swap starts on
start, on or afterexpiry:coupon_bond_option_fromon the fixed leg’s flows, struck at par on the start — a payer is the put, a receiver the call.payer_swaptionandreceiver_swaptionare this with the swap starting on the expiry. - zero_
bond_ option - The price of a European option on a zero-coupon bond, in mode
R. - zero_
bond_ 🔒option_ at zero_bond_optionover curve values already read — the half that depends on the model parameters, so a solver overσreads the curve once and evaluates only this per iterate.