Struct YieldMoments
pub struct YieldMoments {
pub price: f64,
pub first: f64,
pub second: f64,
}Expand description
The price and its first two yield derivatives at one yield, from one second-order pricing pass. Every yield-space measure is a ratio of these, so a caller wanting duration, convexity, and DV01 together prices once and reads three numbers.
Fields§
§price: f64The dirty price P.
first: f64∂P/∂y.
second: f64∂²P/∂y².
Implementations§
§impl YieldMoments
impl YieldMoments
pub fn modified_duration(self) -> f64
pub fn modified_duration(self) -> f64
Modified duration: −P′/P.
pub fn yield_sensitivity(self) -> f64
pub fn yield_sensitivity(self) -> f64
∂y/∂P at this yield — the implicit-function derivative of the
pricing relationship, 1/P′.
pub fn money_duration(self, face: f64) -> f64
pub fn money_duration(self, face: f64) -> f64
Money duration at a stated face: modified duration times the money price. The per-100 figures scale linearly, so this is a reading rather than a second pass.
pub fn money_dv01(self, face: f64) -> f64
pub fn money_dv01(self, face: f64) -> f64
DV01 in money at a stated face — dv01 scaled from per
100 face to the bond’s own.
Trait Implementations§
§impl Clone for YieldMoments
impl Clone for YieldMoments
§fn clone(&self) -> YieldMoments
fn clone(&self) -> YieldMoments
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for YieldMoments
§impl Debug for YieldMoments
impl Debug for YieldMoments
§impl PartialEq for YieldMoments
impl PartialEq for YieldMoments
impl StructuralPartialEq for YieldMoments
Auto Trait Implementations§
impl Freeze for YieldMoments
impl RefUnwindSafe for YieldMoments
impl Send for YieldMoments
impl Sync for YieldMoments
impl Unpin for YieldMoments
impl UnsafeUnpin for YieldMoments
impl UnwindSafe for YieldMoments
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more