Struct FxVolSmile
pub struct FxVolSmile {
quotes: Vec<DeltaQuote>,
vols: Vec<f64>,
}Expand description
One expiry’s smile: (quote, vol) nodes, from the lowest strike’s quote
to the highest’s — puts, ATM, calls.
Fields§
§quotes: Vec<DeltaQuote>§vols: Vec<f64>Implementations§
§impl FxVolSmile
impl FxVolSmile
pub fn new(nodes: &[(DeltaQuote, f64)]) -> Result<Self, FxVolError>
pub fn new(nodes: &[(DeltaQuote, f64)]) -> Result<Self, FxVolError>
A smile from (quote, vol) nodes, sorted into quote order.
§Errors
FxVolError::Malformed on no nodes, a delta outside (0, 1), a
non-positive vol, or the same quote twice.
pub fn from_quotes(
atm: f64,
risk_reversal: f64,
butterfly: f64,
) -> Result<Self, FxVolError>
pub fn from_quotes( atm: f64, risk_reversal: f64, butterfly: f64, ) -> Result<Self, FxVolError>
pub fn quotes(&self) -> &[DeltaQuote]
pub fn quotes(&self) -> &[DeltaQuote]
The node quotes, in smile order.
fn position(&self, quote: DeltaQuote) -> Option<usize>
fn position(&self, quote: DeltaQuote) -> Option<usize>
The position of quote on this smile, if it carries one.
fn len(&self) -> usize
Trait Implementations§
§impl Clone for FxVolSmile
impl Clone for FxVolSmile
§fn clone(&self) -> FxVolSmile
fn clone(&self) -> FxVolSmile
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 more§impl Debug for FxVolSmile
impl Debug for FxVolSmile
§impl PartialEq for FxVolSmile
impl PartialEq for FxVolSmile
impl StructuralPartialEq for FxVolSmile
Auto Trait Implementations§
impl Freeze for FxVolSmile
impl RefUnwindSafe for FxVolSmile
impl Send for FxVolSmile
impl Sync for FxVolSmile
impl Unpin for FxVolSmile
impl UnsafeUnpin for FxVolSmile
impl UnwindSafe for FxVolSmile
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