Docs / nablatensor-quant / com.nablatensor.quant

class

HullWhite1F

Hull-White one-factor short rate as a step block (Seam 5):

dr = a (b - r) dt + sigma dW

A flat mean-reversion level b stands in for the full theta(t) term structure — enough to demonstrate rate-model parameter risk (dV/da, dV/dsigma, dV/db) from one adjoint sweep. The path carries a trapezoidal accumulator for integral(r dt) so a stochastic discount factor is available.

Constructors

HullWhite1F(Nabla.Inputs<HullWhiteMarket> in, double maturity, int steps)

Methods

State start(AadRecorder rec, Nabla.Inputs<HullWhiteMarket> in)
State step(AadRecorder rec, State s, ADouble z)
protected ADouble drift(ADouble meanReversionTerm)

Hook: the per-step deterministic rate move. Identity for plain Hull-White.

protected ADouble diffusion(ADouble volatility)

Hook: the volatility multiplier on the Brownian increment. Identity for plain Hull-White.

static ADouble discountFactor(State s)

exp(-integral(r dt)) along this path.

static BiConsumer<AadRecorder, Nabla.Inputs<HullWhiteMarket>> caplet(double maturity, int steps, double tau, double notional)

A caplet on the simulated short rate: notional * tau * max(r_T - K, 0) paid at T and discounted along the path. Stylised (the underlying is the short rate itself, not a forward LIBOR) but exercises the full parameter gradient.

static BiConsumer<AadRecorder, Nabla.Inputs<HullWhiteMarket>> zeroCouponBond(double maturity, int steps)

Zero-coupon bond price E[exp(-integral r dt)].

ADouble bond(ADouble rt, double t, double horizon)

Analytic reconstruction bond P(t, T) from the simulated short rate r_t, for an initial curve with a flat instantaneous forward f(0, .) = r0:

B(t,T) = (1 - e^{-a(T-t)}) / a
P(t,T) = exp( -r0 (T-t) + B r0 - sigma^2/(4a) B^2 (1 - e^{-2 a t}) - B r_t )
static BiConsumer<AadRecorder, Nabla.Inputs<HullWhiteMarket>> europeanSwaption(double expiry, int swapPeriods, double accrual, int steps, double strike)

Physically-settled European payer swaption expiring at expiry on an n-period annual swap struck at K: at expiry the swap rate and annuity are rebuilt from analytic bond prices given the simulated r_T, and the payoff annuity * max(swapRate - K, 0) is discounted along the path.