Struct PySurvivalCurve
pub struct PySurvivalCurve {
pub(crate) inner: Arc<Survival>,
pub(crate) provenance: Option<Arc<CurveProvenance>>,
pub(crate) refit: Option<Arc<SurvivalRefit>>,
}Expand description
A survival curve: an issuer’s or an index’s probability of surviving to a date.
Fields§
§inner: Arc<Survival>§provenance: Option<Arc<CurveProvenance>>The ladder the curve was bootstrapped from, when it was; carried into
with_credit_curve so a par-basis reading on the credit axis can flip
through it, exactly as a DiscountCurve carries its own.
refit: Option<Arc<SurvivalRefit>>What the curve was calibrated from, when it was; carried into
with_credit_curve so quote-held recovery risk can solve it again.
Implementations§
§impl PySurvivalCurve
impl PySurvivalCurve
pub(crate) fn __repr__(&self) -> String
pub(crate) fn new(
reference: NaiveDate,
pillars: Vec<(NaiveDate, f64)>,
day_count: Option<Named<DayCountFraction>>,
) -> PyResult<Self>
pub(crate) fn new( reference: NaiveDate, pillars: Vec<(NaiveDate, f64)>, day_count: Option<Named<DayCountFraction>>, ) -> PyResult<Self>
Builds a piecewise curve from (date, survival_probability) pillars.
pub(crate) fn default_density(
reference: NaiveDate,
nodes: Vec<(NaiveDate, f64)>,
day_count: Option<Named<DayCountFraction>>,
) -> PyResult<Self>
pub(crate) fn default_density( reference: NaiveDate, nodes: Vec<(NaiveDate, f64)>, day_count: Option<Named<DayCountFraction>>, ) -> PyResult<Self>
A curve stated by its default density: (date, density) nodes, the first on
reference, the density linear between them and flat past the last;
survival is one less its integral.
pub(crate) fn flat_hazard(
reference: NaiveDate,
hazard: f64,
day_count: Option<Named<DayCountFraction>>,
) -> PyResult<Self>
pub(crate) fn flat_hazard( reference: NaiveDate, hazard: f64, day_count: Option<Named<DayCountFraction>>, ) -> PyResult<Self>
A curve with one constant hazard rate.
pub(crate) fn survival(&self, at: NaiveDate) -> PyResult<f64>
pub(crate) fn survival(&self, at: NaiveDate) -> PyResult<f64>
The probability of surviving to a date.
pub(crate) fn hazard_rate(&self, at: NaiveDate) -> PyResult<f64>
pub(crate) fn hazard_rate(&self, at: NaiveDate) -> PyResult<f64>
The instantaneous hazard rate −d/dt ln S at a date.
pub(crate) fn density_at(&self, at: NaiveDate) -> PyResult<f64>
pub(crate) fn density_at(&self, at: NaiveDate) -> PyResult<f64>
The default density h·S at a date;
default_density is the constructor from densities.
Trait Implementations§
§impl Clone for PySurvivalCurve
impl Clone for PySurvivalCurve
§fn clone(&self) -> PySurvivalCurve
fn clone(&self) -> PySurvivalCurve
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 PySurvivalCurve
§impl IntoPy<Py<PyAny>> for PySurvivalCurve
impl IntoPy<Py<PyAny>> for PySurvivalCurve
§impl PyClass for PySurvivalCurve
impl PyClass for PySurvivalCurve
§impl PyClassImpl for PySurvivalCurve
impl PyClassImpl for PySurvivalCurve
§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<PySurvivalCurve>
type ThreadChecker = SendablePyClass<PySurvivalCurve>
§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<PySurvivalCurve> for PyClassImplCollector<PySurvivalCurve>
impl PyClassNewTextSignature<PySurvivalCurve> for PyClassImplCollector<PySurvivalCurve>
fn new_text_signature(self) -> Option<&'static str>
§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PySurvivalCurve
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PySurvivalCurve
§impl PyMethods<PySurvivalCurve> for PyClassImplCollector<PySurvivalCurve>
impl PyMethods<PySurvivalCurve> for PyClassImplCollector<PySurvivalCurve>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PySurvivalCurve
impl PyTypeInfo for PySurvivalCurve
§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.