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: f64Power-law exponent in (0, 1].
theta_pillars: Vec<(f64, f64)>(t, theta_t) pillars, t and theta strictly increasing.
Implementations§
Source§impl Ssvi
impl Ssvi
Sourcepub fn theta(&self, t: f64) -> f64
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.
Sourcepub fn total_variance(&self, k: f64, t: f64) -> f64
pub fn total_variance(&self, k: f64, t: f64) -> f64
Total variance w(k, t).
Sourcepub fn vol(&self, strike: f64, forward: f64, t: f64) -> f64
pub fn vol(&self, strike: f64, forward: f64, t: f64) -> f64
Implied vol for strike given the forward at expiry t.
Sourcepub fn validate(&self) -> Result<(), RustyQLibError>
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.
Sourcepub fn calibrate(
quotes: &[(f64, f64, f64)],
theta_pillars: &[(f64, f64)],
start: (f64, f64, f64),
) -> SsviFit
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).
Sourcepub fn to_vol_surface(
&self,
reference_date: NaiveDate,
day_count: DayCountConvention,
expiry_forwards: &[(f64, f64)],
log_moneyness_grid: &[f64],
) -> Result<VolSurface, VolError>
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.