Struct ZeroCouponInflationCapFloor
pub struct ZeroCouponInflationCapFloor {
pub currency: Currency,
pub index: String,
pub collateral: CollateralSpec,
pub base_date: NaiveDate,
pub maturity: NaiveDate,
pub notional: f64,
pub strike: f64,
pub kind: CapFloorKind,
pub day_count: DayCountFraction,
pub lag_months: u32,
}Expand description
A zero-coupon inflation cap or floor on a price index.
Fields§
§currency: CurrencyThe currency the option pays in.
index: StringThe price index, by registry code.
collateral: CollateralSpecThe discounting the option is priced on.
base_date: NaiveDateThe base date: the flow date whose lagged observation is the ratio’s denominator, and where the strike’s compounding starts.
maturity: NaiveDateMaturity: the payment date, and the flow date whose lagged observation is the numerator.
notional: f64The notional.
strike: f64The annualised zero-coupon strike k, as a decimal.
kind: CapFloorKindCap or floor.
day_count: DayCountFractionThe day count τ in (1+k)^τ is measured on.
lag_months: u32The indexation lag, in whole months.
Implementations§
§impl ZeroCouponInflationCapFloor
impl ZeroCouponInflationCapFloor
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 option on index from base_date to maturity, on
notional, struck at the annualised rate strike, observing at
lag_months, τ on ACT/365F.
§Errors
CapFloorError::NonFiniteStrike for a strike that is not a finite
number above −100% ((1+k)^τ is then undefined);
CapFloorError::EmptyStrip if maturity is not after base_date.
pub fn accruing(self, day_count: DayCountFraction) -> Self
pub fn accruing(self, day_count: DayCountFraction) -> Self
This option with τ measured on day_count.
pub fn year_fraction(&self) -> f64
pub fn year_fraction(&self) -> f64
τ, the day count from the base date to maturity.
pub fn ratio_strike(&self) -> f64
pub fn ratio_strike(&self) -> f64
The strike on the index ratio, (1+k)^τ.
§impl ZeroCouponInflationCapFloor
impl ZeroCouponInflationCapFloor
pub fn index_ratio<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<R, PricingError>
pub fn index_ratio<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<R, PricingError>
The forward index ratio I(T)/I(T0), each level observed as the
zero-coupon inflation swap observes it: a print first, the curve
otherwise.
§Errors
Trait Implementations§
§impl Clone for ZeroCouponInflationCapFloor
impl Clone for ZeroCouponInflationCapFloor
§fn clone(&self) -> ZeroCouponInflationCapFloor
fn clone(&self) -> ZeroCouponInflationCapFloor
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 ZeroCouponInflationCapFloor
impl Debug for ZeroCouponInflationCapFloor
§impl PartialEq for ZeroCouponInflationCapFloor
impl PartialEq for ZeroCouponInflationCapFloor
§fn eq(&self, other: &ZeroCouponInflationCapFloor) -> bool
fn eq(&self, other: &ZeroCouponInflationCapFloor) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for ZeroCouponInflationCapFloor
impl<R: Scalar> Priceable<R> for ZeroCouponInflationCapFloor
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
N·DF(T)·option(F, (1+k)^τ), F the forward index ratio: Black-76 on
F for a lognormal CPI vol surface, Bachelier on it for a normal one,
the vol read at the optionlet time and k; the intrinsic value once
the terminal observation is published or the time has run out;
nothing once maturity has passed.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
Unsupported: an option 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: an option carries no margin.
§impl PricingRiskFactors for ZeroCouponInflationCapFloor
impl PricingRiskFactors for ZeroCouponInflationCapFloor
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
Discounts on the option’s collateral, observes its price index and reads the index’s zero-coupon CPI vol surface.
§impl Product for ZeroCouponInflationCapFloor
impl Product for ZeroCouponInflationCapFloor
§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.