Skip to main content

LatticeMoments

Struct LatticeMoments 

pub struct LatticeMoments {
    pub price: f64,
    pub first: f64,
    pub second: f64,
}
Expand description

The callable’s clean price and its first two derivatives with respect to a parallel continuous shift of the discounting, from one lattice pass.

The lattice-space sibling of YieldMoments: every effective measure is a ratio of these three numbers, so a caller wanting duration, convexity and DV01 together prices once and reads three.

The price is the clean price per 100 face, matching clean_price_at_oas and callable_oas, so the ratios are in the units the bond is quoted in.

§Not the risk vector’s sum

This is not the sum of the bond’s zero-rate risk ladder, and the two should not be reconciled. That sum is Σᵢ ∂P/∂paramᵢ · ∂paramᵢ/∂s, and ∂paramᵢ/∂s depends on what the curve family stores — 1 for a zero-rate pillar, −τᵢ for a log-discount one — so the bare sum is only the parallel sensitivity under one parameterisation. These moments are taken from a shift of the discounting itself and are family-independent.

Fields§

§price: f64

The clean price per 100 face.

§first: f64

∂P/∂s for a parallel continuous shift s.

§second: f64

∂²P/∂s².

Implementations§

§

impl LatticeMoments

pub fn effective_duration(self) -> f64

Effective duration: −P′/P.

“Effective” because the exercise decision moves with the shift — the callable’s cashflows are rate-dependent, so this is not its yield duration.

pub fn effective_convexity(self) -> f64

Effective convexity: P″/P. Negative where the call binds, which is the defining feature of a callable.

pub fn effective_dv01(self) -> f64

Effective DV01 per 100 face: the price change for a one-basis-point parallel shift.

Trait Implementations§

§

impl Clone for LatticeMoments

§

fn clone(&self) -> LatticeMoments

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 Copy for LatticeMoments

§

impl Debug for LatticeMoments

§

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

Formats the value using the given formatter. Read more
§

impl PartialEq for LatticeMoments

§

fn eq(&self, other: &LatticeMoments) -> 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 LatticeMoments

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.