Function discount_bond_affine
pub fn discount_bond_affine<R: Scalar>(
params: &HullWhiteParameters<R>,
curve: &dyn YieldCurve<R>,
t: NaiveDate,
maturity: NaiveDate,
) -> Result<(R, R), CurveError>Expand description
The affine factors of the model’s discount bond seen from t:
P(t, T; r) = A(t, T) · e^{−B(t, T)·r}, with
B = (1 − e^{−a(T−t)}) / a and
A = P(0,T)/P(0,t) · exp(B·f(0,t) − σ²(1 − e^{−2at}) B² / 4a).
Everything is in the mode — the curve ratio, the forward, the parameters
— so a bond price evaluated at a lattice node carries the curve’s and the
parameters’ sensitivities. Freezing the forward passively, as an earlier
lattice asset did, dropped the ∂P/∂curve term through it at every
exercise node.
§Errors
Whatever the curve reports for t, T or the forward stencil.