Struct PyCpiVolSurface
pub struct PyCpiVolSurface {
pub(crate) inner: CpiVolSurface,
}Expand description
A zero-coupon CPI option volatility surface over expiry × annualised
zero-coupon strike — what a zero-coupon inflation cap, floor or collared
CPI notional reads, pinned per price index. Lognormal is Black-76 on the
forward index ratio I(T)/I(T0) at strike (1+k)^τ; normal is Bachelier
on the same ratio, the vol in ratio units. Read at the time from the first
of the month of (valuation − lag) to maturity − lag, ACT/365F.
Fields§
§inner: CpiVolSurfaceImplementations§
§impl PyCpiVolSurface
impl PyCpiVolSurface
pub(crate) fn new(
expiries: Vec<f64>,
strikes: Vec<f64>,
vols: Vec<Vec<f64>>,
vol_convention: Named<VolConvention>,
) -> PyResult<Self>
pub(crate) fn new( expiries: Vec<f64>, strikes: Vec<f64>, vols: Vec<Vec<f64>>, vol_convention: Named<VolConvention>, ) -> PyResult<Self>
A surface over ascending expiries (years) × ascending annualised
zero-coupon strikes, one row of vols per expiry and one entry per
strike.
pub(crate) fn flat(
vol: f64,
vol_convention: Named<VolConvention>,
) -> PyResult<Self>
pub(crate) fn flat( vol: f64, vol_convention: Named<VolConvention>, ) -> PyResult<Self>
One vol at every expiry and strike.
pub(crate) fn strikes(&self) -> Option<Vec<f64>>
pub(crate) fn strikes(&self) -> Option<Vec<f64>>
The annualised strikes the smile is quoted on; None on a flat
surface.
pub(crate) fn vol_convention(&self) -> String
pub(crate) fn vol_convention(&self) -> String
Whether the vols are normal or lognormal.
pub(crate) fn vol(&self, expiry_years: f64, strike: f64) -> f64
pub(crate) fn vol(&self, expiry_years: f64, strike: f64) -> f64
The vol at expiry_years and the annualised strike: linear in vol
between strikes, linear in total variance between expiries, flat
beyond every edge.
fn __repr__(&self) -> String
Trait Implementations§
§impl Clone for PyCpiVolSurface
impl Clone for PyCpiVolSurface
§fn clone(&self) -> PyCpiVolSurface
fn clone(&self) -> PyCpiVolSurface
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl DerefToPyAny for PyCpiVolSurface
§impl IntoPy<Py<PyAny>> for PyCpiVolSurface
impl IntoPy<Py<PyAny>> for PyCpiVolSurface
§impl PyClass for PyCpiVolSurface
impl PyClass for PyCpiVolSurface
§impl PyClassImpl for PyCpiVolSurface
impl PyClassImpl for PyCpiVolSurface
§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type ThreadChecker = SendablePyClass<PyCpiVolSurface>
type ThreadChecker = SendablePyClass<PyCpiVolSurface>
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
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<PyCpiVolSurface> for PyClassImplCollector<PyCpiVolSurface>
impl PyClassNewTextSignature<PyCpiVolSurface> for PyClassImplCollector<PyCpiVolSurface>
fn new_text_signature(self) -> Option<&'static str>
§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyCpiVolSurface
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyCpiVolSurface
§impl PyMethods<PyCpiVolSurface> for PyClassImplCollector<PyCpiVolSurface>
impl PyMethods<PyCpiVolSurface> for PyClassImplCollector<PyCpiVolSurface>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PyCpiVolSurface
impl PyTypeInfo for PyCpiVolSurface
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
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
object is an instance of this type.