Skip to main content

Ssvi

Struct Ssvi 

Source
pub struct Ssvi {
    pub rho: f64,
    pub eta: f64,
    pub gamma: f64,
    pub theta_pillars: Vec<(f64, f64)>,
}
Expand description

SSVI surface: ATM total-variance pillars plus global (rho, eta, gamma) with the power-law curvature.

Fields§

§rho: f64§eta: f64§gamma: f64

Power-law exponent in (0, 1].

§theta_pillars: Vec<(f64, f64)>

(t, theta_t) pillars, t and theta strictly increasing.

Implementations§

Source§

impl Ssvi

Source

pub fn theta(&self, t: f64) -> f64

ATM total variance at t: proportional below the first pillar (variance accrues from zero), linear between pillars, and continued with the last segment’s slope beyond.

Source

pub fn phi(&self, theta: f64) -> f64

Power-law curvature phi(theta).

Source

pub fn total_variance(&self, k: f64, t: f64) -> f64

Total variance w(k, t).

Source

pub fn vol(&self, strike: f64, forward: f64, t: f64) -> f64

Implied vol for strike given the forward at expiry t.

Source

pub fn validate(&self) -> Result<(), RustyQLibError>

Static no-arbitrage checks (Gatheral-Jacquier): admissible parameters, nondecreasing theta (calendar), the power-law sufficient condition eta (1 + |rho|) <= 2, and the per-pillar butterfly bounds theta phi (1 + |rho|) <= 4 and theta phi^2 (1 + |rho|) <= 4.

Source

pub fn calibrate( quotes: &[(f64, f64, f64)], theta_pillars: &[(f64, f64)], start: (f64, f64, f64), ) -> SsviFit

Calibrate (rho, eta, gamma) to surface quotes (t, k, vol) given the ATM total-variance pillars, by Levenberg-Marquardt on total-variance residuals (tanh / exp / logistic transforms keep every trial admissible).

Source

pub fn to_vol_surface( &self, reference_date: NaiveDate, day_count: DayCountConvention, expiry_forwards: &[(f64, f64)], log_moneyness_grid: &[f64], ) -> Result<VolSurface, VolError>

Sample the SSVI surface into the canonical pricing VolSurface: per expiry (t, forward), strikes are placed at forward * exp(k) over the log-moneyness grid.

Trait Implementations§

Source§

impl Clone for Ssvi

Source§

fn clone(&self) -> Ssvi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Ssvi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Ssvi

§

impl RefUnwindSafe for Ssvi

§

impl Send for Ssvi

§

impl Sync for Ssvi

§

impl Unpin for Ssvi

§

impl UnsafeUnpin for Ssvi

§

impl UnwindSafe for Ssvi

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V