Struct PyHullWhite
pub(crate) struct PyHullWhite {
inner: HullWhite,
}Expand description
A validated one-factor Hull-White model: mean reversion a and a
volatility — flat, or a piecewise-constant term — the value a calibration
writes and a caller pins.
Fields§
§inner: HullWhiteImplementations§
§impl PyHullWhite
impl PyHullWhite
fn new(mean_reversion: f64, sigma: PySigmaInput) -> PyResult<Self>
fn new(mean_reversion: f64, sigma: PySigmaInput) -> PyResult<Self>
A model with mean reversion a (strictly positive) and volatility
sigma: a non-negative float, or (t_end, σ) pieces with strictly
increasing positive ends in years.
fn mean_reversion(&self) -> f64
fn mean_reversion(&self) -> f64
Mean-reversion speed a.
fn sigma(&self, py: Python<'_>) -> PyObject
fn sigma(&self, py: Python<'_>) -> PyObject
Short-rate volatility: the float for a flat model, the (t_end, σ)
pieces otherwise.
fn b(&self, t: f64, maturity: f64) -> f64
fn b(&self, t: f64, maturity: f64) -> f64
B(t, T) = (1 − e^{−a(T−t)}) / a, the model’s duration factor, in
years.
fn bond_option_vol(&self, expiry: f64, bond_maturity: f64) -> f64
fn bond_option_vol(&self, expiry: f64, bond_maturity: f64) -> f64
The volatility of the bond_maturity discount bond seen from expiry,
both in years; zero when the option has no life or the bond matures at
expiry.
fn variance(&self, s: f64, t: f64) -> f64
fn variance(&self, s: f64, t: f64) -> f64
V(s, t): the variance of the model’s Gaussian factor at t given
its state at s, both in years.
fn drift_convexity(&self, t: f64) -> f64
fn drift_convexity(&self, t: f64) -> f64
C(t): the drift convexity Cov(∫₀ᵗ x, x_t), the displacement over
the forward at t years.
fn integrated_variance(&self, s: f64, t: f64) -> f64
fn integrated_variance(&self, s: f64, t: f64) -> f64
I(s, t): the variance of ∫ₛᵗ x given the state at s.
fn convexity_exponent(&self, t: f64, maturity: f64) -> f64
fn convexity_exponent(&self, t: f64, maturity: f64) -> f64
Λ: the futures convexity exponent of a term rate fixing at t and
running to maturity (years), E[1/P(t, T)] = P(0, t)/P(0, T)·e^Λ.
fn compounded_convexity_exponent(&self, start: f64, end: f64) -> f64
fn compounded_convexity_exponent(&self, start: f64, end: f64) -> f64
The compounded futures convexity exponent from start to end
(years): what with_hull_white_convexity applies to a futures rate
compounded in arrears.
fn __repr__(&self) -> String
Trait Implementations§
§impl Clone for PyHullWhite
impl Clone for PyHullWhite
§fn clone(&self) -> PyHullWhite
fn clone(&self) -> PyHullWhite
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 PyHullWhite
§impl IntoPy<Py<PyAny>> for PyHullWhite
impl IntoPy<Py<PyAny>> for PyHullWhite
§impl PyClass for PyHullWhite
impl PyClass for PyHullWhite
§impl PyClassImpl for PyHullWhite
impl PyClassImpl for PyHullWhite
§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<PyHullWhite>
type ThreadChecker = SendablePyClass<PyHullWhite>
§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<PyHullWhite> for PyClassImplCollector<PyHullWhite>
impl PyClassNewTextSignature<PyHullWhite> for PyClassImplCollector<PyHullWhite>
fn new_text_signature(self) -> Option<&'static str>
§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyHullWhite
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyHullWhite
§impl PyMethods<PyHullWhite> for PyClassImplCollector<PyHullWhite>
impl PyMethods<PyHullWhite> for PyClassImplCollector<PyHullWhite>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PyHullWhite
impl PyTypeInfo for PyHullWhite
§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.