Skip to main content

HullWhiteParameters

Struct HullWhiteParameters 

pub struct HullWhiteParameters<R: Scalar> {
    pub mean_reversion: R,
    pub sigma: SigmaTerm<R>,
}
Expand description

Hull-White model parameters resolved from the market, in the pricing mode.

These are market inputs, not contract terms: they arrive through the exogenous-scalar seam under the canonical labels, are lifted with everything else, and their sensitivities — lattice vega, mean-reversion risk, vega per volatility piece — appear on the ordinary exogenous risk axes.

Fields§

§mean_reversion: R

The mean-reversion speed a.

§sigma: SigmaTerm<R>

The short-rate volatility: flat, or a piecewise-constant term.

Implementations§

§

impl<R: Scalar> HullWhiteParameters<R>

pub fn flat(mean_reversion: R, sigma: R) -> Self

Parameters with a flat volatility.

pub fn passive(&self) -> HullWhiteParameters<f64>

The derivative-free projection of the parameters.

§

impl<R: Scalar> HullWhiteParameters<R>

pub fn b(&self, t: f64, maturity: f64) -> R

B(t, T) = (1 − e^{−a(T−t)}) / a, the model’s duration factor, in the mode — so a mean-reversion sensitivity flows through it.

pub fn bond_option_vol(&self, expiry: f64, bond_maturity: f64) -> R

The volatility of the S-maturity discount bond seen from expiry T.

sigma_p = √V(0, T) · B(T, S) — sigma · sqrt((1 − e^{−2aT}) / 2a) · B(T, S) for a flat volatility. Zero when the option has no life or the bond matures at expiry, which is the degenerate case the option formula falls back to intrinsic on.

pub fn variance(&self, s: f64, t: f64) -> R

V(s, t) = ∫ₛᵗ σ(u)² e^{−2a(t−u)} du: the variance of the Gaussian factor x_t given x_s. A sum over the pieces overlapping [s, t], each σ_k² · e^{−2a(t−hi)} · φ(2a, hi − lo); zero for t ≤ s.

pub fn drift_convexity(&self, t: f64) -> R

C(t) = ∫₀ᵗ σ(u)² e^{−a(t−u)} B(u, t) du = Cov(∫₀ᵗ x, x_t): the drift convexity, α(t) = f(0, t) + C(t). Per piece σ_k²/2 · (φ(a, t−lo)² − φ(a, t−hi)²), since d/dv φ(a, v)²/2 = e^{−av}φ(a, v).

pub fn integrated_variance(&self, s: f64, t: f64) -> R

I(s, t) = ∫ₛᵗ σ(u)² B(u, t)² du: the variance of ∫ₛᵗ x given the state at s — the in-period variance an in-arrears period accrues. Per piece σ_k² · (H(t−lo) − H(t−hi)), H(v) = ∫₀ᵛ B(θ)² dθ.

pub fn convexity_exponent(&self, t: f64, maturity: f64) -> R

The futures convexity exponent Λ of a term rate fixing at t and running to maturity (years): B(t,T)²·V(0,t) + B(t,T)·C(t) — hull_white_convexity_exponent itself for a flat volatility.

pub fn compounded_convexity_exponent(&self, start: f64, end: f64) -> R

The compounded futures convexity exponent from start to end (years): the term exponent over the period plus the in-period variance I(start, end) — hull_white_compounded_convexity_exponent itself for a flat volatility.

Trait Implementations§

§

impl<R: Clone + Scalar> Clone for HullWhiteParameters<R>

§

fn clone(&self) -> HullWhiteParameters<R>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<R: Debug + Scalar> Debug for HullWhiteParameters<R>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.