Skip to main content

HullWhite

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: f64

Mean-reversion speed a. Strictly positive.

§sigma: SigmaTerm<f64>

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

Implementations§

§

impl HullWhite

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>

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>

The parameters in mode R — a passive lift, carrying no derivatives.

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

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

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

C(t), the drift convexity Cov(∫₀ᵗ x, x_t).

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

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

The compounded futures convexity exponent from start to end (years): the exponent with_hull_white_convexity applies to a compounded-in-arrears futures rate.

Trait Implementations§

§

impl Clone for HullWhite

§

fn clone(&self) -> HullWhite

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 Debug for HullWhite

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for HullWhite

§

fn eq(&self, other: &HullWhite) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for HullWhite

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.