pub enum VolInput {
Flat {
vol: f64,
day_count: DayCountConvention,
},
StrikeExpiry {
expiries: Vec<Tenor>,
strikes: Vec<f64>,
vols: Vec<Vec<f64>>,
day_count: DayCountConvention,
},
MoneynessExpiry {
expiries: Vec<Tenor>,
moneyness: Vec<f64>,
vols: Vec<Vec<f64>>,
day_count: DayCountConvention,
},
DeltaExpiry {
expiries: Vec<Tenor>,
deltas: Vec<f64>,
vols: Vec<Vec<f64>>,
day_count: DayCountConvention,
},
}Expand description
The accepted input forms for a volatility surface. Deserializes from
JSON; canonicalized at construction (VolSurface::from_input).
For the grid forms, vols[i][j] is the vol at expiries[i] and the
j-th strike/moneyness/delta.
Variants§
Flat
A single constant volatility for all strikes and expiries.
StrikeExpiry
Absolute strike x expiry grid (equity convention).
MoneynessExpiry
Forward moneyness (K/F) x expiry grid.
DeltaExpiry
Forward call delta x expiry grid (FX convention).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VolInput
impl<'de> Deserialize<'de> for VolInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for VolInput
impl RefUnwindSafe for VolInput
impl Send for VolInput
impl Sync for VolInput
impl Unpin for VolInput
impl UnsafeUnpin for VolInput
impl UnwindSafe for VolInput
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