Enum SurvivalView
#[non_exhaustive]pub enum SurvivalView<'a, R: Scalar> {
FlatHazard(FlatHazardView<'a, R>),
Isda(IsdaSurvivalView<'a, R>),
Piecewise(PiecewiseSurvivalView<'a, R>),
Shocked(ShockedSurvivalView<'a, R>),
Scaled(ScaledSurvivalView<'a, R>),
Density(DensitySurvivalView<'a, R>),
}Expand description
A Survival lifted into one pricing mode.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
FlatHazard(FlatHazardView<'a, R>)
See Survival::FlatHazard.
Isda(IsdaSurvivalView<'a, R>)
See Survival::Isda.
Piecewise(PiecewiseSurvivalView<'a, R>)
See Survival::Piecewise.
Shocked(ShockedSurvivalView<'a, R>)
See Survival::Shocked.
Scaled(ScaledSurvivalView<'a, R>)
See Survival::Scaled.
Density(DensitySurvivalView<'a, R>)
See Survival::Density.
Trait Implementations§
§impl<'a, R: Clone + Scalar> Clone for SurvivalView<'a, R>
impl<'a, R: Clone + Scalar> Clone for SurvivalView<'a, R>
§fn clone(&self) -> SurvivalView<'a, R>
fn clone(&self) -> SurvivalView<'a, R>
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 more§impl<'a, R: Debug + Scalar> Debug for SurvivalView<'a, R>
impl<'a, R: Debug + Scalar> Debug for SurvivalView<'a, R>
§impl<R: Scalar> SurvivalProbability<R> for SurvivalView<'_, R>
impl<R: Scalar> SurvivalProbability<R> for SurvivalView<'_, R>
§fn reference_date(&self) -> NaiveDate
fn reference_date(&self) -> NaiveDate
The date at which the survival probability is 1.
§fn survival_probability(&self, date: NaiveDate) -> Result<R, CurveError>
fn survival_probability(&self, date: NaiveDate) -> Result<R, CurveError>
The survival probability
S(t) = P(τ > t). Read more§fn log_survival(&self, date: NaiveDate) -> Result<R, CurveError>
fn log_survival(&self, date: NaiveDate) -> Result<R, CurveError>
The log survival
ln S(t) = −∫h — the composition seam on the credit
side. A shocked curve adds to it and exponentiates once; the families
answer it from what they store rather than ln an exp. Read more§fn survival_probability_at_ordinal(&self, ordinal: i32) -> Result<R, CurveError>
fn survival_probability_at_ordinal(&self, ordinal: i32) -> Result<R, CurveError>
The survival probability at the proleptic-Gregorian day number
ordinal — the credit side of
YieldCurve::discount_at_ordinal.
A family whose day count is actual days over a constant answers it by
integer subtraction; the default converts back to a date. Read more§fn log_survival_at_ordinal(&self, ordinal: i32) -> Result<R, CurveError>
fn log_survival_at_ordinal(&self, ordinal: i32) -> Result<R, CurveError>
§fn hazard_rate(&self, date: NaiveDate) -> Result<R, CurveError>
fn hazard_rate(&self, date: NaiveDate) -> Result<R, CurveError>
The instantaneous hazard rate
h(t) = −d/dt ln S(t). Read more§fn default_probability(&self, date: NaiveDate) -> Result<R, CurveError>
fn default_probability(&self, date: NaiveDate) -> Result<R, CurveError>
The default probability
P(t) = 1 − S(t). Read more§fn default_density(&self, date: NaiveDate) -> Result<R, CurveError>
fn default_density(&self, date: NaiveDate) -> Result<R, CurveError>
The default density
f(t) = h(t)·S(t). Read moreAuto Trait Implementations§
impl<'a, R> Freeze for SurvivalView<'a, R>where
R: Freeze,
impl<'a, R> RefUnwindSafe for SurvivalView<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for SurvivalView<'a, R>
impl<'a, R> Sync for SurvivalView<'a, R>
impl<'a, R> Unpin for SurvivalView<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for SurvivalView<'a, R>where
R: UnsafeUnpin,
impl<'a, R> UnwindSafe for SurvivalView<'a, R>where
R: UnwindSafe + RefUnwindSafe,
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