Quantij quantitative finance education and research
Hull–White Model: Fit the Yield Curve and Price Options
Build the one-factor Hull–White model, fit today’s discount curve, and calibrate to bond options in Python.
Published 27 November 2026 · 20 min read
The idea: separate the curve from the shocks
Start with a curve of discount factors from market instruments. Bootstrapping means solving each new curve pillar so that its associated instrument reprices using the earlier pillars and the chosen interpolation. For collateralised derivatives, use the discount curve appropriate to the collateral agreement. A separate curve can be required to forecast floating coupons.
Define , where is today’s discount factor. Hull–White splits the short rate into a zero-mean stochastic factor and a deterministic shift.
From Gaussian discounting, . Differentiate with respect to maturity. The variance derivative is the squared Brownian kernel at horizon , yielding the shift.
The SDE and exact simulation
Differentiate the shift and substitute to get the SDE. Here is a drift intercept. If your library writes , then .
Simulate directly to avoid differentiating the forward curve in the drift. With , the next state is:
Add the shift at each grid time. Check time-step convergence when using numerical integration of the rate for discounting. If you need exact discounting, sample the Gaussian integral jointly with the next state.
Price a zero-coupon bond
Set and . Integrating the future factor conditional on its current value yields the affine bond formula:
At the exponent vanishes because and . At maturity . Verify both identities numerically. Curve interpolation also matters: a continuous discount function may still have discontinuous forwards. Check the interpolation and extrapolation assumptions against your product horizons.
Calibrate to options, then check the fit
Under the expiry-forward measure, the bond forward is lognormal with total log standard deviation . For a strike , the call is:
If , use the discounted intrinsic value. Changing the expiry and underlying maturity changes how the quote responds to and . Fit across both dimensions and inspect the residual surface rather than trusting one aggregate error.
The following code calibrates to synthetic bond-option prices at four expiry–maturity pairs. It is a parameter-recovery exercise. It does not use live quotes.
from math import exp, expm1, log, sqrt
from scipy.optimize import least_squares
from scipy.special import ndtr
def p0(t):
return exp(-0.035*t)
def bond_call(s, t, strike, a, sigma):
b = -expm1(-a*(t-s))/a
v = sigma**2 * (-expm1(-2*a*s))/(2*a)
nu = b*sqrt(v)
f = p0(t)/p0(s)
if nu == 0:
return p0(s)*max(f-strike, 0)
d1 = log(f/strike)/nu + nu/2
return p0(s)*(f*ndtr(d1)-strike*ndtr(d1-nu))
contracts = [(s,t,p0(t)/p0(s)) for s,t in [(1,3),(1,8),(3,7),(5,15)]]
prices = [bond_call(*c,.12,.009) for c in contracts]
def residual(params):
return [1e4*(bond_call(*c,*params)-price)
for c,price in zip(contracts,prices)]
fit = least_squares(residual, [.2,.015], bounds=([.001,.0001],[2,.1]))
assert fit.success and max(abs(fit.fun)) < 1e-6From caps and swaptions to a calibration basket
Caps consist of caplets with different fixing dates. Convert quoted normal or shifted-lognormal volatilities to prices using the supplied quote conventions. In a single-curve setup, each caplet can be expressed using a discount-bond option. In a multi-curve setup, handle the forwarding spread and discounting conventions explicitly.
For a European swaption in the standard single-curve one-factor setting with the required monotonicity, Jamshidian’s decomposition finds the short rate at expiry where the underlying coupon-bond value equals the strike equivalent. It then prices the payoff as a sum of zero-coupon bond options. Use the correct exercise date, coupon schedule and settlement convention. Bermudan exercise requires a numerical procedure such as a tree, PDE, or regression Monte Carlo.
Minimise , where can be a bid–ask scale with a sensible floor. Compare fitted quotes across expiry and tenor and inspect scenarios in which two parameter sets give similar errors. Refit after perturbing quotes to see whether is actually identified.
Build a practical validation checklist
Reprice all bootstrapping instruments first. Confirm call–put parity for bond options and agreement between the analytic formula and Monte Carlo within sampling error. Compare changes under curve bumps, volatility bumps and alternate interpolation. For a callable product, check convergence in both state resolution and the time grid.
One factor cannot capture independent changes in curve level, slope and curvature. Constant volatility also limits the fit across option expiries. A piecewise volatility can improve expiry fit, but adds degrees of freedom that should be validated out of sample.
From synthetic examples to market calibration
Convert market vol quotes to prices using the correct quote convention, then price each cap or swaption with its own cash flows. Compare errors to bid–ask spreads and perturb inputs to see whether a and σ are stable. A single Gaussian factor can match the initial curve while still missing volatility smiles and independent movements across curve tenors.