pub enum Model {
Gbm,
LocalVol,
Heston(HestonParams),
}Expand description
The dynamics of the underlying — orthogonal to the numerical engine (Monte Carlo and finite difference both consult it). Heston carries its parameters, so “Heston selected but parameters missing” cannot be represented.
Variants§
Gbm
Black-Scholes dynamics on the option’s vol surface.
LocalVol
Dupire local volatility calibrated from the vol surface.
Heston(HestonParams)
Heston stochastic volatility.
Implementations§
Source§impl Model
impl Model
pub fn is_heston(&self) -> bool
Sourcepub fn with_vol_shift(&self, shift: f64) -> Model
pub fn with_vol_shift(&self, shift: f64) -> Model
The model under a parallel implied-vol shift — the model is a risk
factor owner like a surface or a curve. GBM and local vol read the
(already bumped) surface at pricing time, so they pass through
unchanged; Heston applies the library’s vega convention: shift
sqrt(v0) and sqrt(theta) in parallel
(HestonParams::with_vol_shift),
rather than recalibrating to the bumped surface.
Sourcepub fn from_contract(
mc_model: Option<&str>,
heston: Option<HestonParams>,
) -> Result<Model, RustyQLibError>
pub fn from_contract( mc_model: Option<&str>, heston: Option<HestonParams>, ) -> Result<Model, RustyQLibError>
Parse from contract fields: the mc_model string plus the
heston parameter block (required when the model is Heston).