Function yield_to_worst_of
fn yield_to_worst_of(
bond: &CallableBond,
dirty: f64,
settlement: NaiveDate,
basis: YieldBasis,
) -> Result<(NaiveDate, f64), YieldSolveError>Expand description
Yield to worst at dirty: the lowest yield over the redemption
scenarios — maturity at par, together with every exercise date strictly
after settlement — returned with the date attaining it.
The issuer exercises to the holder’s disadvantage, so the worst case for the holder is the minimum yield. An empty schedule gives the yield to maturity and reports the maturity date.
CallPrice::MakeWhole entries are skipped: their redemption is
curve-dependent, so they are not scenarios this can rank. A schedule of
nothing but make-whole entries therefore degrades to yield to maturity.
That is a stated limit of this version, not a silent one — the single-entry
[yield_to_call] reports the same entries as an error rather than skipping.
§Errors
YieldSolveError when a scenario admits no yield.