Struct PyHullWhiteLattice
pub(crate) struct PyHullWhiteLattice {
inner: HullWhiteLattice<f64>,
}Expand description
The Hull-White trinomial lattice, built and curve-fitted on construction.
The grid runs from the curve’s reference date to horizon at
steps_per_year, with every mandatory date placed on a slice exactly.
Fields§
§inner: HullWhiteLattice<f64>Implementations§
§impl PyHullWhiteLattice
impl PyHullWhiteLattice
fn new( model: &PyHullWhite, curve: &PyDiscountCurve, horizon: NaiveDate, steps_per_year: u32, mandatory: Option<Vec<NaiveDate>>, ) -> PyResult<Self>
fn step_of(&self, date: NaiveDate) -> Option<usize>
fn step_of(&self, date: NaiveDate) -> Option<usize>
The slice index of date: exact on a grid date, else the nearest
slice, or None outside the grid.
fn levels(&self, step: usize) -> PyResult<Vec<i64>>
fn levels(&self, step: usize) -> PyResult<Vec<i64>>
The node levels j at step, from −half_width to half_width.
fn discount_bond(&self, maturity: NaiveDate, oas: f64) -> PyResult<f64>
fn discount_bond(&self, maturity: NaiveDate, oas: f64) -> PyResult<f64>
A unit payment at maturity rolled back to the root under a
continuously compounded spread oas — the lattice’s discount factor.
fn __repr__(&self) -> String
§impl PyHullWhiteLattice
impl PyHullWhiteLattice
fn check_step(&self, step: usize) -> PyResult<()>
Trait Implementations§
impl DerefToPyAny for PyHullWhiteLattice
§impl IntoPy<Py<PyAny>> for PyHullWhiteLattice
impl IntoPy<Py<PyAny>> for PyHullWhiteLattice
§impl PyClass for PyHullWhiteLattice
impl PyClass for PyHullWhiteLattice
§impl PyClassImpl for PyHullWhiteLattice
impl PyClassImpl for PyHullWhiteLattice
§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<PyHullWhiteLattice>
type ThreadChecker = SendablePyClass<PyHullWhiteLattice>
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<PyHullWhiteLattice> for PyClassImplCollector<PyHullWhiteLattice>
impl PyClassNewTextSignature<PyHullWhiteLattice> for PyClassImplCollector<PyHullWhiteLattice>
fn new_text_signature(self) -> Option<&'static str>
§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyHullWhiteLattice
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyHullWhiteLattice
§impl PyMethods<PyHullWhiteLattice> for PyClassImplCollector<PyHullWhiteLattice>
impl PyMethods<PyHullWhiteLattice> for PyClassImplCollector<PyHullWhiteLattice>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PyHullWhiteLattice
impl PyTypeInfo for PyHullWhiteLattice
§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 PyHullWhiteLattice
impl RefUnwindSafe for PyHullWhiteLattice
impl Send for PyHullWhiteLattice
impl Sync for PyHullWhiteLattice
impl Unpin for PyHullWhiteLattice
impl UnsafeUnpin for PyHullWhiteLattice
impl UnwindSafe for PyHullWhiteLattice
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