Struct HullWhite
pub struct HullWhite {
pub mean_reversion: f64,
pub sigma: SigmaTerm<f64>,
}Expand description
A validated one-factor Hull-White model, passive.
The stored form of the parameters: what a calibration writes and a caller
pins. Pricing reads them in the mode — lift produces the
HullWhiteParameters the engines take, and when they come from the market
instead they arrive already lifted, carrying the sensitivities of the inputs
they were resolved from.
Fields§
§mean_reversion: f64Mean-reversion speed a. Strictly positive.
sigma: SigmaTerm<f64>Short-rate volatility: flat, or a piecewise-constant term.
Implementations§
§impl HullWhite
impl HullWhite
pub fn new(mean_reversion: f64, sigma: f64) -> Result<Self, CurveError>
pub fn new(mean_reversion: f64, sigma: f64) -> Result<Self, CurveError>
A model with mean reversion a and a flat volatility sigma.
§Errors
CurveError::Malformed if the mean reversion is not strictly positive
or the volatility is negative.
pub fn with_term(
mean_reversion: f64,
sigma: SigmaTerm<f64>,
) -> Result<Self, CurveError>
pub fn with_term( mean_reversion: f64, sigma: SigmaTerm<f64>, ) -> Result<Self, CurveError>
A model with mean reversion a and the volatility term sigma —
built with SigmaTerm::pieces, which validates its pieces.
§Errors
CurveError::Malformed if the mean reversion is not strictly
positive, or a flat volatility is negative.
pub fn lift<R: Scalar>(&self) -> HullWhiteParameters<R>
pub fn lift<R: Scalar>(&self) -> HullWhiteParameters<R>
The parameters in mode R — a passive lift, carrying no derivatives.
pub fn b(&self, t: f64, maturity: f64) -> f64
pub fn b(&self, t: f64, maturity: f64) -> f64
B(t, T) = (1 − e^{−a(T−t)}) / a, the model’s duration factor.
pub fn bond_option_vol(&self, expiry: f64, bond_maturity: f64) -> f64
pub fn bond_option_vol(&self, expiry: f64, bond_maturity: f64) -> f64
The volatility of the S-maturity discount bond seen from expiry T.
pub fn variance(&self, s: f64, t: f64) -> f64
pub fn variance(&self, s: f64, t: f64) -> f64
V(s, t), the conditional variance of the Gaussian factor over [s, t].
pub fn drift_convexity(&self, t: f64) -> f64
pub fn drift_convexity(&self, t: f64) -> f64
C(t), the drift convexity Cov(∫₀ᵗ x, x_t).
pub fn integrated_variance(&self, s: f64, t: f64) -> f64
pub fn integrated_variance(&self, s: f64, t: f64) -> f64
I(s, t), the variance of ∫ₛᵗ x given the state at s.
pub fn convexity_exponent(&self, t: f64, maturity: f64) -> f64
pub fn convexity_exponent(&self, t: f64, maturity: f64) -> f64
The futures convexity exponent Λ of a term rate fixing at t and
running to maturity (years).
pub fn compounded_convexity_exponent(&self, start: f64, end: f64) -> f64
pub fn compounded_convexity_exponent(&self, start: f64, end: f64) -> f64
The compounded futures convexity exponent from start to end
(years): the exponent with_hull_white_convexity applies to a
compounded-in-arrears futures rate.