Function dirty_price_of_flows_overlaid
pub fn dirty_price_of_flows_overlaid<R: Scalar>(
flows: &[(f64, f64)],
y: f64,
basis: YieldBasis,
overlay: R,
) -> RExpand description
dirty_price_of_flows with a flat continuous overlay s on the
discounting: each flow is scaled by exp(−s·t).
At s = 0 this is dirty_price_of_flows and nothing else — exp(0)
is exactly one, so the multiplication is by a literal 1.0 and no price
moves. The overlay exists to be seeded: ∂P/∂s at zero is the t-weighted
PV moment, which is Macaulay duration once divided by the price. Taking it
this way means the duration is the pricing body’s own derivative rather than
a formula standing beside it.