Enum ModelError
#[non_exhaustive]pub enum ModelError {
NotLognormal {
forward: f64,
strike: f64,
},
CriticalPriceUnsolved,
}Expand description
A model that cannot price the inputs it was given.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NotLognormal
A lognormal model was asked for a non-positive forward or strike.
Not a degenerate case with an obvious answer: ln(F/K) is undefined
here, and intrinsic value is a different model’s answer rather than
this one’s. Reported so a caller reaches for bachelier, which is
defined on the whole line, instead of pricing through a fabrication.
Fields
CriticalPriceUnsolved
The Barone-Adesi–Whaley critical price did not solve: the early-exercise boundary could not be bracketed or did not converge.
Trait Implementations§
§impl Clone for ModelError
impl Clone for ModelError
§fn clone(&self) -> ModelError
fn clone(&self) -> ModelError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ModelError
§impl Debug for ModelError
impl Debug for ModelError
§impl Display for ModelError
impl Display for ModelError
§impl Error for ModelError
impl Error for ModelError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
§impl PartialEq for ModelError
impl PartialEq for ModelError
impl StructuralPartialEq for ModelError
Auto Trait Implementations§
impl Freeze for ModelError
impl RefUnwindSafe for ModelError
impl Send for ModelError
impl Sync for ModelError
impl Unpin for ModelError
impl UnsafeUnpin for ModelError
impl UnwindSafe for ModelError
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