Struct YoyInflationCoupon
pub struct YoyInflationCoupon {Show 13 fields
pub accrual_start: NaiveDate,
pub accrual_end: NaiveDate,
pub payment_date: NaiveDate,
pub notional: f64,
pub gearing: f64,
pub spread: f64,
pub day_count: DayCountFraction,
pub accrual: f64,
pub payment_ordinal: i32,
pub currency: Currency,
pub index: String,
pub lag_months: u32,
pub payoff: Option<RatePayoff>,
}Expand description
A year-on-year inflation coupon: `notional · τ · (g · (I(end)/I(start) − 1)
- s)
, each level the price index observed under the index's lag and interpolation, paid onpayment_date. Apayoffcaps, floors or digitises the rate as on an IBOR coupon, each option a year-on-year optionlet off the index's YoY vol surface (see [crate::marketdata::inflation_vol`]).
Fields§
§accrual_start: NaiveDateAccrual start, and the date the opening level is observed for.
accrual_end: NaiveDateAccrual end, and the date the closing level is observed for.
payment_date: NaiveDatePayment date.
notional: f64The notional. Contract data.
gearing: f64Multiplicative gearing on the year-on-year rate.
spread: f64Additive spread, as a decimal.
day_count: DayCountFractionThe accrual day count.
accrual: f64The accrual year fraction under day_count, evaluated once at build.
payment_ordinal: i32The payment date as a proleptic-Gregorian day number.
currency: CurrencyThe coupon’s currency.
index: StringThe price index’s registry code.
lag_months: u32The observation lag, in months.
payoff: Option<RatePayoff>An option on the coupon’s rate, or None for a plain coupon.
Implementations§
§impl YoyInflationCoupon
impl YoyInflationCoupon
pub fn new(
accrual_start: NaiveDate,
accrual_end: NaiveDate,
payment_date: NaiveDate,
notional: f64,
currency: Currency,
index: impl Into<String>,
lag_months: u32,
day_count: DayCountFraction,
) -> Self
pub fn new( accrual_start: NaiveDate, accrual_end: NaiveDate, payment_date: NaiveDate, notional: f64, currency: Currency, index: impl Into<String>, lag_months: u32, day_count: DayCountFraction, ) -> Self
A plain coupon on index over [accrual_start, accrual_end], paid on
payment_date, observing at lag_months, ungeared and unspread.
pub fn with_payoff(self, payoff: RatePayoff) -> Self
pub fn with_payoff(self, payoff: RatePayoff) -> Self
This coupon with payoff on its rate.
pub fn forward<R: Scalar, C: CurveByIndex<R> + ?Sized>(
&self,
curves: &C,
) -> Result<R, CashflowError>
pub fn forward<R: Scalar, C: CurveByIndex<R> + ?Sized>( &self, curves: &C, ) -> Result<R, CashflowError>
The year-on-year forward I(end)/I(start) − 1, each level read as
every indexed product reads it: a print first, the curve otherwise.
§Errors
CashflowError::NoIndexForCoupon where curves holds no inflation
for the index; the curve’s own errors.
fn closing_published<R: Scalar>(&self, fixings: &FixingsView<'_, R>) -> bool
fn closing_published<R: Scalar>(&self, fixings: &FixingsView<'_, R>) -> bool
Whether every month the closing observation reads is published — the coupon’s rate is then known, and its option is its intrinsic value.
pub fn optionlet<R: Scalar, C: CurveByIndex<R> + ?Sized>(
&self,
forward: R,
strike: f64,
kind: OptionKind,
curves: &C,
as_of: NaiveDate,
) -> Result<R, CashflowError>
pub fn optionlet<R: Scalar, C: CurveByIndex<R> + ?Sized>( &self, forward: R, strike: f64, kind: OptionKind, curves: &C, as_of: NaiveDate, ) -> Result<R, CashflowError>
The undiscounted year-on-year optionlet on forward at the index
strike strike: Bachelier on a normal surface, Black-76 on
F + d, K + d on a lognormal one displaced by d; the vol read at the
optionlet time ACT/365F(first of the month of (as_of − lag), end − lag)
and strike, the variance accruing over that time. A time not after
the vol’s base date is the intrinsic value.
§Errors
CashflowError::PayoffWithoutYoyVols where curves holds no YoY
vols for the index; CashflowError::PayoffNotLognormal where a
lognormal surface meets a non-positive displaced forward or strike.
pub fn option_rate<R: Scalar, C: CurveByIndex<R> + ?Sized>(
&self,
strike: f64,
kind: OptionKind,
curves: &C,
fixings: &FixingsView<'_, R>,
as_of: NaiveDate,
) -> Result<R, CashflowError>
pub fn option_rate<R: Scalar, C: CurveByIndex<R> + ?Sized>( &self, strike: f64, kind: OptionKind, curves: &C, fixings: &FixingsView<'_, R>, as_of: NaiveDate, ) -> Result<R, CashflowError>
pub fn rate_with<R: Scalar, C: CurveByIndex<R> + ?Sized>(
&self,
curves: &C,
fixings: &FixingsView<'_, R>,
as_of: NaiveDate,
) -> Result<R, CashflowError>
pub fn rate_with<R: Scalar, C: CurveByIndex<R> + ?Sized>( &self, curves: &C, fixings: &FixingsView<'_, R>, as_of: NaiveDate, ) -> Result<R, CashflowError>
Trait Implementations§
§impl Clone for YoyInflationCoupon
impl Clone for YoyInflationCoupon
§fn clone(&self) -> YoyInflationCoupon
fn clone(&self) -> YoyInflationCoupon
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 YoyInflationCoupon
impl Debug for YoyInflationCoupon
§impl PartialEq for YoyInflationCoupon
impl PartialEq for YoyInflationCoupon
§fn eq(&self, other: &YoyInflationCoupon) -> bool
fn eq(&self, other: &YoyInflationCoupon) -> bool
self and other values to be equal, and is used by ==.