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§
Implementations§
§impl<'a, R: Scalar> RateSmileView<'a, R>
impl<'a, R: Scalar> RateSmileView<'a, R>
pub fn day_count(&self) -> DayCountFraction
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
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>
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
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>
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>>
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>
pub fn passive(&self) -> RateSmileView<'a, f64>
The derivative-free projection.
Trait Implementations§
§impl<'a, R: Clone + Scalar> Clone for RateSmileView<'a, R>
impl<'a, R: Clone + Scalar> Clone for RateSmileView<'a, R>
§fn clone(&self) -> RateSmileView<'a, R>
fn clone(&self) -> RateSmileView<'a, R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more