Skip to main content

BlackVarianceSurface

Struct BlackVarianceSurface 

Source
pub struct BlackVarianceSurface { /* private fields */ }
Expand description

Black volatility surface interpolating market vols on the variance surface, time-strike dependent.

Implementations§

Source§

impl BlackVarianceSurface

Source

pub fn new( reference_date: Date, calendar: Option<Calendar>, dates: &[Date], strikes: Vec<Real>, black_vol_matrix: &Matrix, day_counter: DayCounter, ) -> QlResult<BlackVarianceSurface>

Surface with interpolator-default strike extrapolation on both sides (the C++ default arguments).

black_vol_matrix holds one row per strike and one column per date.

Source

pub fn with_strike_extrapolation( reference_date: Date, calendar: Option<Calendar>, dates: &[Date], strikes: Vec<Real>, black_vol_matrix: &Matrix, day_counter: DayCounter, lower_extrapolation: Extrapolation, upper_extrapolation: Extrapolation, ) -> QlResult<BlackVarianceSurface>

Surface with explicit lower/upper strike-extrapolation behaviour.

Source

pub fn set_interpolation<I>(&mut self, interpolator: &I) -> QlResult<()>
where I: Interpolator2D, I::Output: 'static,

Rebuilds the variance interpolation with another interpolator (C++’s template setInterpolation; bilinear is the construction default) and notifies observers.

Trait Implementations§

Source§

impl AsObservable for BlackVarianceSurface

Source§

fn observable(&self) -> &Observable

Access to the embedded observable for registering observers.
Source§

impl BlackVolTermStructure for BlackVarianceSurface

Source§

fn black_vol_impl(&self, t: Time, strike: Real) -> QlResult<Volatility>

Black volatility calculation hook; range checks have already run.
Source§

fn black_variance_impl(&self, t: Time, strike: Real) -> QlResult<Real>

Black variance calculation hook; range checks have already run. Read more
Source§

fn variance_from_vol(&self, t: Time, strike: Real) -> QlResult<Real>

Variance derived from the volatility as vol^2 * t (C++’s BlackVolatilityTermStructure adapter).
Source§

fn black_vol_date( &self, maturity: Date, strike: Real, extrapolate: bool, ) -> QlResult<Volatility>

Spot volatility at a date.
Source§

fn black_vol( &self, maturity: Time, strike: Real, extrapolate: bool, ) -> QlResult<Volatility>

Spot volatility at a time.
Source§

fn black_variance_date( &self, maturity: Date, strike: Real, extrapolate: bool, ) -> QlResult<Real>

Spot variance at a date.
Source§

fn black_variance( &self, maturity: Time, strike: Real, extrapolate: bool, ) -> QlResult<Real>

Spot variance at a time.
Source§

fn black_forward_vol_dates( &self, date1: Date, date2: Date, strike: Real, extrapolate: bool, ) -> QlResult<Volatility>

Forward (at-the-money) volatility between two dates.
Source§

fn black_forward_vol( &self, time1: Time, time2: Time, strike: Real, extrapolate: bool, ) -> QlResult<Volatility>

Forward (at-the-money) volatility between two times.
Source§

fn black_forward_variance_dates( &self, date1: Date, date2: Date, strike: Real, extrapolate: bool, ) -> QlResult<Real>

Forward (at-the-money) variance between two dates.
Source§

fn black_forward_variance( &self, time1: Time, time2: Time, strike: Real, extrapolate: bool, ) -> QlResult<Real>

Forward (at-the-money) variance between two times.
Source§

impl TermStructure for BlackVarianceSurface

Source§

fn base(&self) -> &TermStructureBase

The embedded shared holder.
Source§

fn max_date(&self) -> Date

The latest date for which the curve can return values.
Source§

fn day_counter(&self) -> Option<DayCounter>

The day counter used for date/time conversion, when provided.
Source§

fn require_day_counter(&self) -> QlResult<DayCounter>

The day counter, or an error for structures built without one.
Source§

fn calendar(&self) -> Option<Calendar>

The calendar used for reference-date calculation, when provided.
Source§

fn settlement_days(&self) -> QlResult<Natural>

The settlement days used for reference-date calculation.
Source§

fn reference_date(&self) -> QlResult<Date>

The date at which discount = 1.0 and/or variance = 0.0.
Source§

fn time_from_reference(&self, date: Date) -> QlResult<Time>

The period from the reference date to date as a year fraction.
Source§

fn max_time(&self) -> QlResult<Time>

The latest time for which the curve can return values.
Source§

fn allows_extrapolation(&self) -> bool

Whether the curve answers dates/times beyond its maximum.
Source§

fn enable_extrapolation(&self)

Allows extrapolation past the maximum date/time.
Source§

fn disable_extrapolation(&self)

Forbids extrapolation past the maximum date/time.
Source§

fn check_range_date(&self, date: Date, extrapolate: bool) -> QlResult<()>

Date-range check: date must not precede the reference date nor, unless extrapolation applies, exceed the maximum date.
Source§

fn check_range_time(&self, t: Time, extrapolate: bool) -> QlResult<()>

Time-range check: t must be finite, non-negative and, unless extrapolation applies, within the maximum time. Read more
Source§

impl VolatilityTermStructure for BlackVarianceSurface

Source§

fn business_day_convention(&self) -> BusinessDayConvention

The business day convention used in tenor to date conversion.
Source§

fn min_strike(&self) -> Rate

The minimum strike for which the term structure can return vols.
Source§

fn max_strike(&self) -> Rate

The maximum strike for which the term structure can return vols.
Source§

fn option_date_from_tenor(&self, period: Period) -> QlResult<Date>

Period/date conversion, swaption style: the reference date advanced by period on the structure’s calendar per its business-day convention.
Source§

fn check_strike(&self, strike: Rate, extrapolate: bool) -> QlResult<()>

Strike-range check: strike must sit inside the curve domain unless extrapolation applies. Read more

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> 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, 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.