Struct PySabrVolSurface
pub struct PySabrVolSurface {
pub(crate) inner: SabrVolSurface,
}Expand description
A SABR rate smile over expiry × tenor: σ_ATM, ρ and ν at each node, β and
the shift stated once, α implied at each read from the ATM vol at the
read’s own forward. Pinned with with_swaption_vols or with_cap_vols
beside a grid.
Fields§
§inner: SabrVolSurfaceImplementations§
§impl PySabrVolSurface
impl PySabrVolSurface
fn __repr__(&self) -> String
pub(crate) fn new(
expiries: Vec<f64>,
tenors: Vec<f64>,
formula: Named<SabrFormula>,
beta: f64,
shift: f64,
atm_vols: Vec<Vec<f64>>,
rhos: Vec<Vec<f64>>,
nus: Vec<Vec<f64>>,
) -> PyResult<Self>
pub(crate) fn new( expiries: Vec<f64>, tenors: Vec<f64>, formula: Named<SabrFormula>, beta: f64, shift: f64, atm_vols: Vec<Vec<f64>>, rhos: Vec<Vec<f64>>, nus: Vec<Vec<f64>>, ) -> PyResult<Self>
A surface from ascending expiries and tenors, both in years, the
formula, CEV exponent beta and displacement shift, and one row
per expiry of ATM vols, ρs and νs, in tenor order.
fn vol_convention(&self) -> String
fn vol_convention(&self) -> String
The convention the formula’s vols are quoted in: normal or
lognormal.
fn node_parameters(
&self,
expiry_years: f64,
tenor_years: f64,
) -> (f64, f64, f64)
fn node_parameters( &self, expiry_years: f64, tenor_years: f64, ) -> (f64, f64, f64)
The node parameters (atm_vol, rho, nu) at (expiry_years, tenor_years): bilinear between nodes, flat beyond the edges.
Trait Implementations§
§impl Clone for PySabrVolSurface
impl Clone for PySabrVolSurface
§fn clone(&self) -> PySabrVolSurface
fn clone(&self) -> PySabrVolSurface
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 DerefToPyAny for PySabrVolSurface
§impl From<&PySabrVolSurface> for RateSmileArg
impl From<&PySabrVolSurface> for RateSmileArg
§fn from(surface: &PySabrVolSurface) -> Self
fn from(surface: &PySabrVolSurface) -> Self
Converts to this type from the input type.
§impl IntoPy<Py<PyAny>> for PySabrVolSurface
impl IntoPy<Py<PyAny>> for PySabrVolSurface
§impl PyClass for PySabrVolSurface
impl PyClass for PySabrVolSurface
§impl PyClassImpl for PySabrVolSurface
impl PyClassImpl for PySabrVolSurface
§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type ThreadChecker = SendablePyClass<PySabrVolSurface>
type ThreadChecker = SendablePyClass<PySabrVolSurface>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
§impl PyClassNewTextSignature<PySabrVolSurface> for PyClassImplCollector<PySabrVolSurface>
impl PyClassNewTextSignature<PySabrVolSurface> for PyClassImplCollector<PySabrVolSurface>
fn new_text_signature(self) -> Option<&'static str>
§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PySabrVolSurface
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PySabrVolSurface
§impl PyMethods<PySabrVolSurface> for PyClassImplCollector<PySabrVolSurface>
impl PyMethods<PySabrVolSurface> for PyClassImplCollector<PySabrVolSurface>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PySabrVolSurface
impl PyTypeInfo for PySabrVolSurface
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type.Auto Trait Implementations§
impl Freeze for PySabrVolSurface
impl RefUnwindSafe for PySabrVolSurface
impl Send for PySabrVolSurface
impl Sync for PySabrVolSurface
impl Unpin for PySabrVolSurface
impl UnsafeUnpin for PySabrVolSurface
impl UnwindSafe for PySabrVolSurface
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