Function risky_value_over
pub(crate) fn risky_value_over<R: Scalar, D, S>(
flows: &[(NaiveDate, R)],
face_at: impl Fn(NaiveDate) -> R,
boundaries: impl IntoIterator<Item = NaiveDate>,
disc: &D,
survival: &S,
recovery: R,
timing: DefaultPaymentTime,
pays_on: &dyn Fn(NaiveDate) -> NaiveDate,
) -> Result<R, CurveError>where
D: YieldCurve<R>,
S: SurvivalProbability<R>,Expand description
risky_value with the default intervals stated: recovery is walked over
consecutive boundaries, each interval [t₀, t₁] paying
R·F(t̄)·(S(t₀) − S(t₁)) on the face alive at its midpoint t̄ (whole
days, rounded down) — in the mode, so a projected amount can stand for
the face — discounted as timing says: from t̄ itself
(AtDefault), from pays_on(t₁) — the
scheduled payment date for a default in the interval
(AtPeriodEnd) — or from pays_on of
the last boundary (AtMaturity). The
bond walks a RECOVERY_GRID_DAYS-day grid at default; a structured note
walks its coupon periods at default;
a credit-linked swap walks the curves’ node grid under its own timing.
§Errors
Whatever the curves report.