Struct PiecewiseSurvivalView
pub struct PiecewiseSurvivalView<'a, R: Scalar> {
data: &'a PiecewiseSurvival,
params: Cow<'a, [R]>,
}Expand description
PiecewiseSurvival lifted into one pricing mode.
Fields§
§data: &'a PiecewiseSurvival§params: Cow<'a, [R]>Implementations§
§impl<R: Scalar> PiecewiseSurvivalView<'_, R>
impl<R: Scalar> PiecewiseSurvivalView<'_, R>
pub fn parameters(&self) -> &[R]
pub fn parameters(&self) -> &[R]
This mode’s parameters.
fn left_of(&self, hi: usize) -> (f64, R)
fn left_of(&self, hi: usize) -> (f64, R)
The pillar to the left of index hi, with the implicit anchor standing
in at the left end.
fn segment_hazard(&self, hi: usize) -> R
fn segment_hazard(&self, hi: usize) -> R
The constant forward hazard of the segment ending at pillar hi.
fn log_survival_at(&self, tau: f64) -> R
fn log_survival_at(&self, tau: f64) -> R
ln S at tau: linear between pillars, and past the last pillar the
final segment’s hazard continues.
Trait Implementations§
§impl<'a, R: Clone + Scalar> Clone for PiecewiseSurvivalView<'a, R>
impl<'a, R: Clone + Scalar> Clone for PiecewiseSurvivalView<'a, R>
§fn clone(&self) -> PiecewiseSurvivalView<'a, R>
fn clone(&self) -> PiecewiseSurvivalView<'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 PiecewiseSurvivalView<'a, R>
impl<'a, R: Debug + Scalar> Debug for PiecewiseSurvivalView<'a, R>
§impl<R: Scalar> SurvivalProbability<R> for PiecewiseSurvivalView<'_, R>
impl<R: Scalar> SurvivalProbability<R> for PiecewiseSurvivalView<'_, 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 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 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 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 PiecewiseSurvivalView<'a, R>
impl<'a, R> RefUnwindSafe for PiecewiseSurvivalView<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for PiecewiseSurvivalView<'a, R>
impl<'a, R> Sync for PiecewiseSurvivalView<'a, R>
impl<'a, R> Unpin for PiecewiseSurvivalView<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for PiecewiseSurvivalView<'a, R>
impl<'a, R> UnwindSafe for PiecewiseSurvivalView<'a, R>where
R: RefUnwindSafe + UnwindSafe,
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