Skip to main content

RateSmileView

Enum RateSmileView 

pub enum RateSmileView<'a, R: Scalar> {
    Grid(RateVolView<'a, R>),
    Sabr(SabrVolView<'a, R>),
}
Expand description

A rate smile lifted into mode R, whichever representation it is.

Variants§

§

Grid(RateVolView<'a, R>)

A grid.

§

Sabr(SabrVolView<'a, R>)

A SABR surface.

Implementations§

§

impl<'a, R: Scalar> RateSmileView<'a, R>

pub fn day_count(&self) -> DayCountFraction

The day count the smile’s expiries are measured on: a grid’s own, a SABR surface’s Act/365F.

pub fn convention(&self) -> VolConvention

The smile’s convention.

pub fn vol_at( &self, expiry_years: f64, tenor_years: f64, forward: R, strike: f64, ) -> Result<R, RateVolError>

The vol at (expiry_years, tenor_years) of strike at forward — the read every smiled product makes. A grid reads as it always has: at the spread strike − forward (the forward’s passive value) on a surface quoted at spreads, at the strike on one quoted at absolute strikes, at the money on one without a smile; the forward carries no derivative through it. A SABR surface reads its model at the forward, so the forward’s adjoints flow through the vol.

§Errors

RateVolError::Sabr where the SABR smile refuses.

pub fn displacement(&self) -> f64

The displacement a lognormal vol off this smile is priced at: a shifted-lognormal SABR smile’s shift, zero on a grid (whose lognormal vols are plain Black) and on a normal smile (which a shift leaves unchanged).

pub fn undiscounted( &self, forward: R, strike: f64, vol: R, t: f64, kind: OptionKind, ) -> Result<R, ModelError>

The undiscounted option on forward at strike at vol over t, priced in this smile’s convention: Bachelier for a normal smile, Black-76 at displacement for a lognormal one. A grid’s lognormal read prices exactly as plain Black-76.

§Errors

ModelError::NotLognormal for a non-positive displaced forward or strike under a lognormal smile.

pub fn grid(&self) -> Option<&RateVolView<'a, R>>

The grid, where the smile is one — for the reads only a grid answers.

pub fn passive(&self) -> RateSmileView<'a, f64>

The derivative-free projection.

Trait Implementations§

§

impl<'a, R: Clone + Scalar> Clone for RateSmileView<'a, R>

§

fn clone(&self) -> RateSmileView<'a, 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<'a, R: Debug + Scalar> Debug for RateSmileView<'a, R>

§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, R> Freeze for RateSmileView<'a, R>

§

impl<'a, R> RefUnwindSafe for RateSmileView<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for RateSmileView<'a, R>

§

impl<'a, R> Sync for RateSmileView<'a, R>

§

impl<'a, R> Unpin for RateSmileView<'a, R>
where R: Unpin,

§

impl<'a, R> UnsafeUnpin for RateSmileView<'a, R>

§

impl<'a, R> UnwindSafe for RateSmileView<'a, R>

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.