Skip to main content

ShockedSurvival

Struct ShockedSurvival 

pub struct ShockedSurvival {
    base: Box<Survival>,
    shift: f64,
    label: String,
}
Expand description

A base credit curve under a named parallel hazard shock: h(t) + Δ, and so S(t)·exp(−Δ·τ).

The shift is stated data carrying a label, not a free parameter — the same rule the discount side’s shock follows, and for the same reason: a scenario is what a report keys a row by, not something a solve moves.

Fields§

§base: Box<Survival>§shift: f64§label: String

Implementations§

§

impl ShockedSurvival

pub fn parallel(base: Survival, shift: f64, label: impl Into<String>) -> Self

base with every hazard shifted by shift, reported under label.

The shock measures time under the base’s own day count — carrying a second convention here would let S, h and the density disagree with each other, since hazard_rate reports h + Δ on the base’s measure.

pub fn base(&self) -> &Survival

The unshocked curve.

pub fn label(&self) -> &str

The name a scenario report keys this perturbation by.

pub fn view<R: Scalar>(&self) -> ShockedSurvivalView<'_, R>

This transform lifted into mode R.

pub(crate) fn view_with_slice<'a, R: Scalar>( &'a self, rest: &mut &'a [R], ) -> ShockedSurvivalView<'a, R>

One step of a substituted walk. See take_params.

Reaches the base only, for the same reason the seeded walk does.

pub(crate) fn view_seeding<R: Scalar + Seedable>( &self, seed: &mut Option<usize>, ) -> ShockedSurvivalView<'_, R>

One step of the seeded walk. The seed reaches the base only; see ShockedSurvival’s note on why the shift is not a parameter.

Trait Implementations§

§

impl Clone for ShockedSurvival

§

fn clone(&self) -> ShockedSurvival

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ShockedSurvival

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl PartialEq for ShockedSurvival

§

fn eq(&self, other: &ShockedSurvival) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for ShockedSurvival

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.