pub struct SVISlice {
pub params: SVIParams,
}Expand description
Represents the SVI volatility model for a single maturity slice. Contains the parameters and implements the SVI calculation logic.
Fields§
§params: SVIParamsImplementations§
Source§impl SVISlice
impl SVISlice
Sourcepub fn new(params: SVIParams) -> Self
pub fn new(params: SVIParams) -> Self
Creates a new SVISlice instance from validated SVIParams.
Sourcepub fn total_variance_at_k(&self, k: f64) -> f64
pub fn total_variance_at_k(&self, k: f64) -> f64
Calculates total variance w(k) using the SVI formula: w(k) = a + b * (ρ(k-m) + sqrt((k-m)² + σ²))
Sourcepub fn implied_vol(&self, k: f64) -> f64
pub fn implied_vol(&self, k: f64) -> f64
Calculates implied volatility σ(k) from total variance.
Trait Implementations§
Source§impl SurfaceModel for SVISlice
impl SurfaceModel for SVISlice
Source§fn validate_params(&self) -> Result<()>
fn validate_params(&self) -> Result<()>
Validates the internal parameters using the shared helper function.
Source§fn total_variance(&self, k: f64, t: f64) -> Result<f64>
fn total_variance(&self, k: f64, t: f64) -> Result<f64>
Calculates the model’s implied total variance.
Requires t to be within ~5 minutes of the slice’s params.t.
Source§fn check_calendar_arbitrage(&self, _k: f64, _t1: f64, _t2: f64) -> Result<()>
fn check_calendar_arbitrage(&self, _k: f64, _t1: f64, _t2: f64) -> Result<()>
Checks for calendar spread arbitrage. Returns Ok(()) as it’s not applicable for a single slice.
Source§fn check_butterfly_arbitrage_at_k(&self, k: f64, t: f64) -> Result<()>
fn check_butterfly_arbitrage_at_k(&self, k: f64, t: f64) -> Result<()>
Checks for butterfly spread arbitrage violations at k and t.
Uses Gatheral’s g(k) condition: g(k) = (1 - kw’/(2w))² - (w’)²/4 * (1/w + 1/4) + w’’/2 >= 0
Requires t to be within ~5 minutes of the slice’s params.t.
type Parameters = SVIParams
fn parameters(&self) -> &Self::Parameters
impl StructuralPartialEq for SVISlice
Auto Trait Implementations§
impl Freeze for SVISlice
impl RefUnwindSafe for SVISlice
impl Send for SVISlice
impl Sync for SVISlice
impl Unpin for SVISlice
impl UnwindSafe for SVISlice
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.