Function risky_value
pub fn risky_value<R: Scalar, D, S>(
flows: &[(NaiveDate, R)],
face_at: impl Fn(NaiveDate) -> f64,
maturity: NaiveDate,
disc: &D,
survival: &S,
recovery: R,
default_from: NaiveDate,
) -> Result<R, CurveError>where
D: YieldCurve<R>,
S: SurvivalProbability<R>,Expand description
The survival-weighted value of flows plus a recovery-of-face leg.
Each promised flow pays only if the issuer survives to its date:
Σ amount·DF(t)·S(t). Default pays recovery · face_at(mid) — recovery on
the face alive at the midpoint of the interval it falls in, which an
amortiser pays down — over RECOVERY_GRID_DAYS-day intervals from
default_from to maturity: Σ_j R·F(t̄_j)·DF(t̄_j)·(S(t_{j−1}) − S(t_j)).
Every term is in the mode, so the value carries discount, spread, hazard
and recovery sensitivities on their own axes. The recovery leg is walked
even at a zero recovery, whose value it leaves untouched, so the recovery
sensitivity there is not dropped.
§Errors
Whatever the curves report.