Struct ResolvedCredit
pub struct ResolvedCredit<'a, R: Scalar> {
inner: Lifted<'a, Survival, SurvivalView<'a, R>>,
recovery: Option<R>,
}Expand description
The credit data resolved for one pricing call.
Fields§
§inner: Lifted<'a, Survival, SurvivalView<'a, R>>§recovery: Option<R>Implementations§
§impl<'a, R: Scalar> ResolvedCredit<'a, R>
impl<'a, R: Scalar> ResolvedCredit<'a, R>
pub fn lift(storage: &'a Survival, recovery: Option<f64>) -> Self
pub fn lift(storage: &'a Survival, recovery: Option<f64>) -> Self
storage lifted into mode R, with an optional market recovery
lifted as a constant.
pub fn substituted(
storage: &'a Survival,
params: &'a [R],
recovery: Option<R>,
) -> Result<Self, PricingError>
pub fn substituted( storage: &'a Survival, params: &'a [R], recovery: Option<R>, ) -> Result<Self, PricingError>
storage lifted over params in place of its stored ones — how a risk
pass installs registered handles on the credit side — with the market
recovery in the mode, so a sensitivity can be taken to it.
§Errors
PricingError::Curve if params is the wrong length for storage.
pub fn curve(&self) -> &SurvivalView<'a, R>
pub fn curve(&self) -> &SurvivalView<'a, R>
The entity’s survival curve in this mode.
pub fn passive(&self) -> ResolvedCredit<'a, f64>
pub fn passive(&self) -> ResolvedCredit<'a, f64>
The same credit data, carrying no derivatives.
Trait Implementations§
§impl<'a, R: Clone + Scalar> Clone for ResolvedCredit<'a, R>
impl<'a, R: Clone + Scalar> Clone for ResolvedCredit<'a, R>
§fn clone(&self) -> ResolvedCredit<'a, R>
fn clone(&self) -> ResolvedCredit<'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 ResolvedCredit<'a, R>
impl<'a, R: Debug + Scalar> Debug for ResolvedCredit<'a, R>
§impl<R: Scalar> SurvivalProbability<R> for ResolvedCredit<'_, R>
impl<R: Scalar> SurvivalProbability<R> for ResolvedCredit<'_, 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 ResolvedCredit<'a, R>where
R: Freeze,
impl<'a, R> RefUnwindSafe for ResolvedCredit<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for ResolvedCredit<'a, R>
impl<'a, R> Sync for ResolvedCredit<'a, R>
impl<'a, R> Unpin for ResolvedCredit<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for ResolvedCredit<'a, R>where
R: UnsafeUnpin,
impl<'a, R> UnwindSafe for ResolvedCredit<'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