Struct RateVolView
pub struct RateVolView<'a, R: Scalar> {
data: &'a RateVolSurface,
params: Cow<'a, [R]>,
}Expand description
A surface lifted into mode R.
Fields§
§data: &'a RateVolSurface§params: Cow<'a, [R]>Implementations§
§impl<'a, R: Scalar> RateVolView<'a, R>
impl<'a, R: Scalar> RateVolView<'a, R>
pub fn parameters(&self) -> &[R]
pub fn parameters(&self) -> &[R]
The lifted node vols, in parameter order.
pub fn convention(&self) -> VolConvention
pub fn convention(&self) -> VolConvention
The surface’s convention.
pub fn day_count(&self) -> DayCountFraction
pub fn day_count(&self) -> DayCountFraction
The day count the surface’s expiry axis is measured on.
pub fn strikes(&self) -> Option<&[f64]>
pub fn strikes(&self) -> Option<&[f64]>
The strike pillars, on the surface’s own strike axis, where it carries a smile.
pub fn strike_axis(&self) -> StrikeAxis
pub fn strike_axis(&self) -> StrikeAxis
What the surface’s strike pillars measure.
fn row(&self, i: usize, strike: Option<f64>) -> Vec<R>
fn row(&self, i: usize, strike: Option<f64>) -> Vec<R>
Row i of the lifted grid — one expiry’s vols across the tenors, with
the strike axis collapsed at strike. None takes the first column,
which is the whole grid where the surface carries no smile.
fn across_expiry(&self, col: &[R], expiry: f64) -> R
fn across_expiry(&self, col: &[R], expiry: f64) -> R
Collapses the expiry axis over the per-expiry column col at
expiry: flat in vol beyond the edges, linear in total variance
between pillars.
pub fn vol(&self, expiry_years: f64, tenor_years: f64) -> R
pub fn vol(&self, expiry_years: f64, tenor_years: f64) -> R
The at-the-money vol at (expiry_years, tenor_years): linear in vol
across the tenor axis, linear in total variance across the expiry axis,
flat beyond every edge. Both coordinates are passive — a swaption’s
expiry and tenor are contract terms.
This is the read of a surface without a smile. A surface carrying one is
read through vol_at_strike, and resolution keeps
a smiled surface out of the registries whose reads name no strike.
pub fn vol_at_strike(
&self,
expiry_years: f64,
tenor_years: f64,
strike: f64,
) -> Result<R, RateVolError>
pub fn vol_at_strike( &self, expiry_years: f64, tenor_years: f64, strike: f64, ) -> Result<R, RateVolError>
The vol at (expiry_years, tenor_years) and strike: the strike axis
collapsed first — linear in vol between strikes, flat beyond both edges
— then the tenor and expiry collapses of vol. A surface
quoted at the money carries no strike axis and returns exactly what
vol returns, whatever the strike.
§Errors
RateVolError::WrongStrikeAxis on a surface quoted at spreads to the
forward: an absolute strike names no column of it, and the forward it
would be measured against is the instrument’s to supply.
pub fn vol_at_spread(
&self,
expiry_years: f64,
tenor_years: f64,
spread: f64,
) -> Result<R, RateVolError>
pub fn vol_at_spread( &self, expiry_years: f64, tenor_years: f64, spread: f64, ) -> Result<R, RateVolError>
The vol at (expiry_years, tenor_years) and spread — the read a
swaption makes, its spread being strike − forward.
§Errors
RateVolError::WrongStrikeAxis on a surface whose strikes are
absolute rates: a spread names no column of it.
fn read(&self, expiry_years: f64, tenor_years: f64, strike: Option<f64>) -> R
fn read(&self, expiry_years: f64, tenor_years: f64, strike: Option<f64>) -> R
The three-axis collapse both reads share.
pub fn vol_at_tenor_in(&self, expiry_years: f64, tenor_years: R) -> R
pub fn vol_at_tenor_in(&self, expiry_years: f64, tenor_years: R) -> R
pub fn passive(&self) -> RateVolView<'a, f64>
pub fn passive(&self) -> RateVolView<'a, f64>
The derivative-free projection.
Trait Implementations§
§impl<'a, R: Clone + Scalar> Clone for RateVolView<'a, R>
impl<'a, R: Clone + Scalar> Clone for RateVolView<'a, R>
§fn clone(&self) -> RateVolView<'a, R>
fn clone(&self) -> RateVolView<'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