Struct StepCredit
pub struct StepCredit<R> {
pub survival: Vec<R>,
pub recovery: Vec<R>,
}Expand description
An issuer’s credit on a lattice’s steps: for step i (slice i to
i + 1), the survival over it S(tᵢ₊₁)/S(tᵢ) and the recovery a default
in it pays at its end, R·F(tᵢ)·(1 − S(tᵢ₊₁)/S(tᵢ)) on the face alive at
its start. Branch probabilities sum to one, so the recovery needs none.
Fields§
§survival: Vec<R>Survival over each step, conditional on its start.
recovery: Vec<R>The recovery cash each step’s default pays at its end.
Implementations§
§impl<R: Scalar> StepCredit<R>
impl<R: Scalar> StepCredit<R>
pub fn on_grid<S: SurvivalProbability<R>>(
grid: &TimeGrid,
survival: &S,
recovery: R,
face_at: impl Fn(NaiveDate) -> f64,
) -> Result<Self, CurveError>
pub fn on_grid<S: SurvivalProbability<R>>( grid: &TimeGrid, survival: &S, recovery: R, face_at: impl Fn(NaiveDate) -> f64, ) -> Result<Self, CurveError>
The credit on grid’s steps from the issuer’s survival curve, the
market recovery and the face alive on each date.
§Errors
Whatever the survival curve reports.
Trait Implementations§
§impl<R: Clone> Clone for StepCredit<R>
impl<R: Clone> Clone for StepCredit<R>
§fn clone(&self) -> StepCredit<R>
fn clone(&self) -> StepCredit<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 moreAuto Trait Implementations§
impl<R> Freeze for StepCredit<R>
impl<R> RefUnwindSafe for StepCredit<R>where
R: RefUnwindSafe,
impl<R> Send for StepCredit<R>where
R: Send,
impl<R> Sync for StepCredit<R>where
R: Sync,
impl<R> Unpin for StepCredit<R>where
R: Unpin,
impl<R> UnsafeUnpin for StepCredit<R>
impl<R> UnwindSafe for StepCredit<R>where
R: 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