Struct DensitySurvivalView
pub struct DensitySurvivalView<'a, R: Scalar> {
data: &'a DensitySurvival,
params: Cow<'a, [R]>,
}Expand description
DensitySurvival lifted into one pricing mode.
Fields§
§data: &'a DensitySurvival§params: Cow<'a, [R]>Implementations§
§impl<R: Scalar> DensitySurvivalView<'_, R>
impl<R: Scalar> DensitySurvivalView<'_, R>
pub fn parameters(&self) -> &[R]
pub fn parameters(&self) -> &[R]
This mode’s parameters.
fn node(&self, k: usize) -> R
fn node(&self, k: usize) -> R
The density at node k: its own parameter, or — the reference node
of a flat-first curve — the first pillar’s.
fn density_at(&self, tau: f64) -> R
fn density_at(&self, tau: f64) -> R
The density at tau: linear between nodes, flat past the last.
fn defaulted_by(&self, tau: f64) -> R
fn defaulted_by(&self, tau: f64) -> R
∫₀^tau f: whole segments by the trapezoid, the part segment to
tau likewise, and the flat tail past the last node.
fn survival_at(&self, tau: f64) -> Result<R, CurveError>
Trait Implementations§
§impl<'a, R: Clone + Scalar> Clone for DensitySurvivalView<'a, R>
impl<'a, R: Clone + Scalar> Clone for DensitySurvivalView<'a, R>
§fn clone(&self) -> DensitySurvivalView<'a, R>
fn clone(&self) -> DensitySurvivalView<'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 DensitySurvivalView<'a, R>
impl<'a, R: Debug + Scalar> Debug for DensitySurvivalView<'a, R>
§impl<R: Scalar> SurvivalProbability<R> for DensitySurvivalView<'_, R>
impl<R: Scalar> SurvivalProbability<R> for DensitySurvivalView<'_, 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 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 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 moreAuto Trait Implementations§
impl<'a, R> Freeze for DensitySurvivalView<'a, R>
impl<'a, R> RefUnwindSafe for DensitySurvivalView<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for DensitySurvivalView<'a, R>
impl<'a, R> Sync for DensitySurvivalView<'a, R>
impl<'a, R> Unpin for DensitySurvivalView<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for DensitySurvivalView<'a, R>
impl<'a, R> UnwindSafe for DensitySurvivalView<'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