Struct SabrSpec
pub struct SabrSpec {
pub formula: SabrFormula,
pub beta: f64,
pub shift: f64,
pub accept: f64,
pub max_restarts: usize,
}Expand description
How a grid smile is fitted to SABR.
Fields§
§formula: SabrFormulaThe formula the fitted smile is read under.
beta: f64The CEV exponent — configuration, stated by the caller.
shift: f64The displacement — stated by the caller.
accept: f64A slice is accepted when its vega-weighted RMS vol error is at most this fraction of its mean quoted vol.
max_restarts: usizeHow many Halton restarts a slice may spend after its explicit guess.
Implementations§
§impl SabrSpec
impl SabrSpec
pub fn new(
formula: SabrFormula,
beta: f64,
shift: f64,
) -> Result<Self, SabrCalibrationError>
pub fn new( formula: SabrFormula, beta: f64, shift: f64, ) -> Result<Self, SabrCalibrationError>
A spec reading formula with CEV exponent beta and displacement
shift — both stated, never defaulted — accepting a slice at a
relative RMS error of 2e-3 (a fifth of a basis point on a 100bp normal
vol) within 20 restarts.
§Errors
SabrCalibrationError::Spec for a β outside [0, 1] or a non-finite
shift.
pub fn with_accept(self, accept: f64) -> Self
pub fn with_accept(self, accept: f64) -> Self
This spec accepting a slice at most accept relative RMS error.
pub fn with_max_restarts(self, restarts: usize) -> Self
pub fn with_max_restarts(self, restarts: usize) -> Self
This spec spending at most restarts Halton restarts per slice.
pub fn convention(&self) -> VolConvention
pub fn convention(&self) -> VolConvention
The convention the formula’s vols are quoted in.