Skip to main content

YoyInflationCoupon

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 on payment_date. A payoff caps, 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: NaiveDate

Accrual start, and the date the opening level is observed for.

§accrual_end: NaiveDate

Accrual end, and the date the closing level is observed for.

§payment_date: NaiveDate

Payment date.

§notional: f64

The notional. Contract data.

§gearing: f64

Multiplicative gearing on the year-on-year rate.

§spread: f64

Additive spread, as a decimal.

§day_count: DayCountFraction

The accrual day count.

§accrual: f64

The accrual year fraction under day_count, evaluated once at build.

§payment_ordinal: i32

The payment date as a proleptic-Gregorian day number.

§currency: Currency

The coupon’s currency.

§index: String

The price index’s registry code.

§lag_months: u32

The observation lag, in months.

§payoff: Option<RatePayoff>

An option on the coupon’s rate, or None for a plain coupon.

Implementations§

§

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

A plain coupon on index over [accrual_start, accrual_end], paid on payment_date, observing at lag_months, ungeared and unspread.

pub fn geared(self, gearing: f64, spread: f64) -> Self

This coupon paying gearing · YoY + spread.

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>

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

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>

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>

One undiscounted year-on-year option on this coupon’s own forward at strike, as of as_of — what a YoY caplet or floorlet on the period pays per unit of N·τ: the intrinsic value once the closing observation is published or the optionlet time has run out, the optionlet otherwise.

§Errors

As forward and optionlet.

pub fn rate_with<R: Scalar, C: CurveByIndex<R> + ?Sized>( &self, curves: &C, fixings: &FixingsView<'_, R>, as_of: NaiveDate, ) -> Result<R, CashflowError>

The coupon rate g·F + s with its payoff, as of as_of: a settled payoff on a known rate, otherwise the coupon layer’s payoff composed over optionlet.

§Errors

As forward and optionlet; a malformed payoff.

Trait Implementations§

§

impl Clone for YoyInflationCoupon

§

fn clone(&self) -> YoyInflationCoupon

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for YoyInflationCoupon

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl PartialEq for YoyInflationCoupon

§

fn eq(&self, other: &YoyInflationCoupon) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for YoyInflationCoupon

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.