pub enum ParamError {
Show 13 variants
EmptyCollection {
name: &'static str,
},
NegativeSlope {
b: f64,
},
CorrelationOutOfRange {
rho: f64,
},
NonPositiveSigma {
sigma: f64,
},
NegativeMinVariance {
w_min: f64,
},
NonPositiveMaturity {
t: f64,
},
NegativeWeight {
weight: f64,
},
NegativeTotalVariance {
w: f64,
},
InvalidPhiParameter {
name: &'static str,
value: f64,
},
NonPositiveTheta {
theta: f64,
},
NonFinite {
name: &'static str,
},
NotStrictlyIncreasing {
name: &'static str,
index: usize,
previous: f64,
value: f64,
},
DecreasingAtmVariance {
index: usize,
previous: f64,
value: f64,
},
}Expand description
Error returned when SVI / SSVI parameters or market quotes fail validation.
Every SVI parametrisation has a validity domain (raw SVI: b >= 0,
|rho| < 1, sigma > 0, a + b*sigma*sqrt(1-rho^2) >= 0). A constructor
or validate method returns one of these variants when an input lies
outside that domain.
§Examples
use regit_svi::error::ParamError;
let err = ParamError::NegativeSlope { b: -0.1 };
assert_eq!(format!("{err}"), "raw SVI slope b must be non-negative, got -0.1");Variants§
EmptyCollection
A collection that must contain at least one observation was empty.
NegativeSlope
Raw SVI slope b is negative.
CorrelationOutOfRange
Raw SVI / SSVI correlation rho is outside (-1, 1).
NonPositiveSigma
Raw SVI curvature sigma is not strictly positive.
NegativeMinVariance
The minimum total variance a + b*sigma*sqrt(1-rho^2) is negative,
so the slice produces negative variance somewhere.
NonPositiveMaturity
A maturity t is not strictly positive.
NegativeWeight
A fitting weight on a market quote is negative.
NegativeTotalVariance
An observed total variance on a market quote is negative.
InvalidPhiParameter
An SSVI smoothing-function parameter is outside its valid domain
(lambda > 0, eta > 0, gamma in (0, 1)).
Fields
NonPositiveTheta
An SSVI ATM total variance theta is not strictly positive.
NonFinite
A non-finite (NaN or infinite) value was supplied where a finite
number is required.
NotStrictlyIncreasing
Values expected in strictly increasing order were unordered or duplicated.
Fields
DecreasingAtmVariance
An ATM total-variance term structure decreased with maturity.
Trait Implementations§
Source§impl Clone for ParamError
impl Clone for ParamError
Source§fn clone(&self) -> ParamError
fn clone(&self) -> ParamError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ParamError
Source§impl Debug for ParamError
impl Debug for ParamError
Source§impl Display for ParamError
impl Display for ParamError
Source§impl Error for ParamError
impl Error for ParamError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()