Struct YoyInflationCapFloor
pub struct YoyInflationCapFloor {
pub leg: Leg,
pub strike: f64,
pub kind: CapFloorKind,
pub currency: Currency,
pub index: String,
pub lag_months: u32,
pub collateral: CollateralSpec,
}Expand description
A strip of year-on-year inflation caplets or floorlets on a price index.
Fields§
§leg: LegThe strip’s plain year-on-year coupons, received: what each option is written on.
strike: f64The strike every optionlet is struck at, on the YoY rate.
kind: CapFloorKindCap or floor.
currency: CurrencyThe currency the strip pays in.
index: StringThe price index, by registry code.
lag_months: u32The observation lag, in whole months.
collateral: CollateralSpecThe discounting the strip is priced on.
Implementations§
§impl YoyInflationCapFloor
impl YoyInflationCapFloor
pub fn new(
currency: Currency,
index: impl Into<String>,
base_date: NaiveDate,
maturity: NaiveDate,
notional: f64,
strike: f64,
kind: CapFloorKind,
lag_months: u32,
) -> Result<Self, CapFloorError>
pub fn new( currency: Currency, index: impl Into<String>, base_date: NaiveDate, maturity: NaiveDate, notional: f64, strike: f64, kind: CapFloorKind, lag_months: u32, ) -> Result<Self, CapFloorError>
A kind strip on index over annual periods from base_date up to
and including maturity, on notional, struck at strike, observing
at lag_months — the periods a YoyInflationSwap on the same
dates generates: unadjusted, accruing ACT/365F, each paying on its end.
§Errors
CapFloorError::NonFiniteStrike for a NaN or infinite strike;
CapFloorError::EmptyStrip if maturity is not after base_date.
pub fn from_dates(
currency: Currency,
index: impl Into<String>,
dates: &[NaiveDate],
notional: f64,
strike: f64,
kind: CapFloorKind,
lag_months: u32,
) -> Result<Self, CapFloorError>
pub fn from_dates( currency: Currency, index: impl Into<String>, dates: &[NaiveDate], notional: f64, strike: f64, kind: CapFloorKind, lag_months: u32, ) -> Result<Self, CapFloorError>
A strip over caller-supplied boundaries: n + 1 dates for n
periods, each paying on its end, accruing ACT/365F.
§Errors
CapFloorError::NonFiniteStrike for a NaN or infinite strike;
CapFloorError::EmptyStrip for fewer than two boundaries.
pub fn accruing(self, day_count: DayCountFraction) -> Self
pub fn accruing(self, day_count: DayCountFraction) -> Self
This strip with every period accruing on day_count.
Trait Implementations§
§impl Clone for YoyInflationCapFloor
impl Clone for YoyInflationCapFloor
§fn clone(&self) -> YoyInflationCapFloor
fn clone(&self) -> YoyInflationCapFloor
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 YoyInflationCapFloor
impl Debug for YoyInflationCapFloor
§impl PartialEq for YoyInflationCapFloor
impl PartialEq for YoyInflationCapFloor
§fn eq(&self, other: &YoyInflationCapFloor) -> bool
fn eq(&self, other: &YoyInflationCapFloor) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for YoyInflationCapFloor
impl<R: Scalar> Priceable<R> for YoyInflationCapFloor
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
Σ N·τᵢ·DF(payᵢ)·optionletᵢ(K) over the periods still to pay, each
optionlet the one a capped (floored) YoY coupon composes its payoff
from — see YoyInflationCoupon::option_rate.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
Unsupported: a cap is quoted as a price or a vol, not a rate.
§fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
Unsupported: a cap carries no margin.
§impl PricingRiskFactors for YoyInflationCapFloor
impl PricingRiskFactors for YoyInflationCapFloor
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
Discounts on the strip’s collateral, observes its price index and reads the index’s year-on-year optionlet vol surface.
§impl Product for YoyInflationCapFloor
impl Product for YoyInflationCapFloor
§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.