pub struct BlackVarianceSurface { /* private fields */ }Expand description
Black volatility surface interpolating market vols on the variance surface, time-strike dependent.
Implementations§
Source§impl BlackVarianceSurface
impl BlackVarianceSurface
Sourcepub fn new(
reference_date: Date,
calendar: Option<Calendar>,
dates: &[Date],
strikes: Vec<Real>,
black_vol_matrix: &Matrix,
day_counter: DayCounter,
) -> QlResult<BlackVarianceSurface>
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.
Sourcepub 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>
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.
Sourcepub fn set_interpolation<I>(&mut self, interpolator: &I) -> QlResult<()>where
I: Interpolator2D,
I::Output: 'static,
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
impl AsObservable for BlackVarianceSurface
Source§fn observable(&self) -> &Observable
fn observable(&self) -> &Observable
Access to the embedded observable for registering observers.
Source§impl BlackVolTermStructure for BlackVarianceSurface
impl BlackVolTermStructure for BlackVarianceSurface
Source§fn black_vol_impl(&self, t: Time, strike: Real) -> QlResult<Volatility>
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>
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>
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>
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>
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>
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>
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>
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>
fn black_forward_vol( &self, time1: Time, time2: Time, strike: Real, extrapolate: bool, ) -> QlResult<Volatility>
Forward (at-the-money) volatility between two times.
Source§impl TermStructure for BlackVarianceSurface
impl TermStructure for BlackVarianceSurface
Source§fn base(&self) -> &TermStructureBase
fn base(&self) -> &TermStructureBase
The embedded shared holder.
Source§fn day_counter(&self) -> Option<DayCounter>
fn day_counter(&self) -> Option<DayCounter>
The day counter used for date/time conversion, when provided.
Source§fn require_day_counter(&self) -> QlResult<DayCounter>
fn require_day_counter(&self) -> QlResult<DayCounter>
The day counter, or an error for structures built without one.
Source§fn calendar(&self) -> Option<Calendar>
fn calendar(&self) -> Option<Calendar>
The calendar used for reference-date calculation, when provided.
Source§fn settlement_days(&self) -> QlResult<Natural>
fn settlement_days(&self) -> QlResult<Natural>
The settlement days used for reference-date calculation.
Source§fn reference_date(&self) -> QlResult<Date>
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>
fn time_from_reference(&self, date: Date) -> QlResult<Time>
The period from the reference date to
date as a year fraction.Source§fn allows_extrapolation(&self) -> bool
fn allows_extrapolation(&self) -> bool
Whether the curve answers dates/times beyond its maximum.
Source§fn enable_extrapolation(&self)
fn enable_extrapolation(&self)
Allows extrapolation past the maximum date/time.
Source§fn disable_extrapolation(&self)
fn disable_extrapolation(&self)
Forbids extrapolation past the maximum date/time.
Source§impl VolatilityTermStructure for BlackVarianceSurface
impl VolatilityTermStructure for BlackVarianceSurface
Source§fn business_day_convention(&self) -> BusinessDayConvention
fn business_day_convention(&self) -> BusinessDayConvention
The business day convention used in tenor to date conversion.
Source§fn min_strike(&self) -> Rate
fn min_strike(&self) -> Rate
The minimum strike for which the term structure can return vols.
Source§fn max_strike(&self) -> Rate
fn max_strike(&self) -> Rate
The maximum strike for which the term structure can return vols.
Auto Trait Implementations§
impl !Freeze for BlackVarianceSurface
impl !RefUnwindSafe for BlackVarianceSurface
impl !Send for BlackVarianceSurface
impl !Sync for BlackVarianceSurface
impl !UnwindSafe for BlackVarianceSurface
impl Unpin for BlackVarianceSurface
impl UnsafeUnpin for BlackVarianceSurface
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