Function compose_payoff
pub(crate) fn compose_payoff<R: Scalar, E>(
payoff: &RatePayoff,
rate: R,
gearing: f64,
spread: f64,
optionlet: impl Fn(f64, OptionKind) -> Result<R, E>,
) -> Result<R, E>Expand description
payoff on a coupon rate rate = g·X + s still to fix, whatever X
observes: the payoff axis of the coupon layer, composed over any
observation that prices an optionlet on itself. optionlet(k, kind) is
the undiscounted option on X at k, in the coupon’s payment terms. Each
option on the rate at K is one on X at (K − s)/g, times |g|, a
negative gearing swapping calls for puts. A collar is r − caplet(cap) + floorlet(floor); a digital is its call spread (see Digital).
§Errors
The optionlet’s own.