Struct BermudanSwaption
pub struct BermudanSwaption {
pub underlying: SwaptionUnderlying,
pub exercise_dates: Vec<NaiveDate>,
pub strike: f64,
pub kind: SwaptionKind,
}Expand description
A Bermudan swaption: a co-terminal swap exercisable on a set of dates, priced on the Hull-White lattice.
Fields§
§underlying: SwaptionUnderlyingThe co-terminal swap the option confers; exercise on a date enters the swap’s remaining fixed periods.
exercise_dates: Vec<NaiveDate>The exercise dates, strictly ascending, all before the underlying’s last fixed payment.
strike: f64The fixed rate the option confers.
kind: SwaptionKindPayer or receiver.
Implementations§
§impl BermudanSwaption
impl BermudanSwaption
pub fn new(
underlying: SwaptionUnderlying,
exercise_dates: Vec<NaiveDate>,
strike: f64,
kind: SwaptionKind,
) -> Result<Self, SwaptionError>
pub fn new( underlying: SwaptionUnderlying, exercise_dates: Vec<NaiveDate>, strike: f64, kind: SwaptionKind, ) -> Result<Self, SwaptionError>
A Bermudan swaption.
§Errors
SwaptionError for no exercise dates, dates that are not strictly
ascending, a non-finite strike, an empty fixed leg, or a last exercise
on or after the underlying’s last fixed payment.
Trait Implementations§
§impl Clone for BermudanSwaption
impl Clone for BermudanSwaption
§fn clone(&self) -> BermudanSwaption
fn clone(&self) -> BermudanSwaption
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for BermudanSwaption
impl Debug for BermudanSwaption
§impl PartialEq for BermudanSwaption
impl PartialEq for BermudanSwaption
§fn eq(&self, other: &BermudanSwaption) -> bool
fn eq(&self, other: &BermudanSwaption) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for BermudanSwaption
impl<R: Scalar> Priceable<R> for BermudanSwaption
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
Rolls back on a lattice whose grid carries every exercise date — and every fixed payment before the last one — as an exact slice, taking at each exercise slice the larger of continuation and the swap’s model value. Nothing left to exercise after the valuation date is worth nothing.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for BermudanSwaption
impl PricingRiskFactors for BermudanSwaption
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
Discounts on the underlying’s collateral under the currency’s Hull-White parameters, and projects its index: each exercise strikes on the delivered swap’s own floating leg through the basis spread.
§impl Product for BermudanSwaption
impl Product for BermudanSwaption
§fn currency(&self) -> Currency
fn currency(&self) -> Currency
§fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
(name, date) pairs —
exactly the dates its stated constructor takes, so a product built
through a derived form can be read back and rebuilt through the stated
one. Empty for a product with no stated form. No default: every
product states which it is — see AnyInstrument::contract_dates.§fn legs(&self) -> Option<Vec<&Leg>>
fn legs(&self) -> Option<Vec<&Leg>>
None
for a product that holds none — see AnyInstrument::legs. No
default: every product states which it is.§fn final_payment_date(&self) -> Option<NaiveDate>
fn final_payment_date(&self) -> Option<NaiveDate>
None for a product no ladder is built from.§fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
rate — the scalar a par
calibration rung on it is quoted in — or None for a product that
carries no such scalar. What a quote scenario moves a rung to.§fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
spread on its spread
leg, or None for a product that quotes none.