Struct DiscretizedBermudan
struct DiscretizedBermudan<R: Scalar> {
exercises: Vec<(usize, R, Vec<(R, R, R)>)>,
notional: f64,
sign: f64,
last: usize,
}Expand description
The rollback asset for a Bermudan swaption: per exercise slice, the
affine factors of every remaining fixed payment’s discount bond seen from
that date, so the co-terminal swap’s model value at a node is
N·(P(t,S) − Σ c_i·A_i·e^{−B_i·r}) with c_i = (K + s)·τ_i (s the basis
spread that strikes on the swap’s own floating leg), the unit redemption
on the last, and P(t,S) the par leg at the delivered swap’s start. The factors are in the mode — they carry the curve’s and
the parameters’ sensitivities — and the exercise decision compares passive
values, freezing nothing: the exercised node takes the model value, which
is itself active.
Fields§
§exercises: Vec<(usize, R, Vec<(R, R, R)>)>(step, the curve forward f(0, t) the factors were built on, remaining payments as (A, B, coupon)), ascending by step. The forward is kept so
the factors can be re-keyed to the lattice’s own at each slice.
notional: f64§sign: f64+1 for a payer (the holder receives 1 − bond), −1 for a receiver.
last: usizeImplementations§
§impl<R: Scalar> DiscretizedBermudan<R>
impl<R: Scalar> DiscretizedBermudan<R>
fn assemble(
swaption: &BermudanSwaption,
grid: &TimeGrid,
view: &PricingView<'_, R>,
params: &HullWhiteParameters<R>,
) -> Result<Self, PricingError>
fn assemble( swaption: &BermudanSwaption, grid: &TimeGrid, view: &PricingView<'_, R>, params: &HullWhiteParameters<R>, ) -> Result<Self, PricingError>
Assembles the asset on grid, keeping exercises strictly after the
valuation date that still have a fixed payment to enter.
fn swap_value(&self, terms: &[(R, R, R)], r: R, shift: R) -> R
fn swap_value(&self, terms: &[(R, R, R)], r: R, shift: R) -> R
The co-terminal swap’s value to the holder at short rate r, per
unit notional: ±(P(t,S) − Σ c_i·P(t,t_i)), every bond A·e^{−B·r}
with each A moved by e^{B·shift} from the forward it was built on
to the lattice’s. The par leg P(t,S) is the first term, carried at
coupon −1.
Trait Implementations§
§impl<R: Scalar> DiscretizedAsset<R> for DiscretizedBermudan<R>
impl<R: Scalar> DiscretizedAsset<R> for DiscretizedBermudan<R>
§fn last_step(&self) -> usize
fn last_step(&self) -> usize
§fn adjust_values(
&self,
step: usize,
lattice: &HullWhiteLattice<R>,
values: &mut [R],
)
fn adjust_values( &self, step: usize, lattice: &HullWhiteLattice<R>, values: &mut [R], )
step: inject cashflows, apply exercise.
Called once at the terminal step (with zero-initialised values) to
set the terminal payoff, then after each rollback step. values is
indexed by node offset (0 ⇒ j = −half_width). Read more