Struct InflationLinkedBond
pub struct InflationLinkedBond {
pub real: FixedRateBond,
pub index: String,
pub base_index: f64,
pub lag_months: u32,
pub collateral: CollateralSpec,
pub redemption_floor: bool,
pub issuer: Option<CreditCurveId>,
pub security_spread: Option<String>,
pub interpolation: Option<IndexInterpolation>,
}Expand description
An inflation-linked bond: a real coupon on a nominal schedule, every flow
scaled by I(lagged(t)) / I_base against a named price index.
A bet on the index, not on the coupon. The lagged index level is a published fixing when one exists at the observation date and the curve’s projection otherwise; the redemption is floored at par when the floor is set — an option on the terminal index level, worth exactly nothing once the index ends above its base.
Fields§
§real: FixedRateBondThe real twin: a fixed-rate bullet on the real coupon, whose flows are the un-indexed amounts.
index: StringThe price index, by name — the key the market stores the inflation curve and its fixings under.
base_index: f64The index level the flows are scaled against.
lag_months: u32The indexation lag, in calendar months.
collateral: CollateralSpecThe discounting key.
redemption_floor: boolWhether the redemption is floored at par.
issuer: Option<CreditCurveId>The issuer, when the bond is valued risky.
security_spread: Option<String>A security-spread key composed onto the discounting.
interpolation: Option<IndexInterpolation>How the index is observed inside the month, where the bond states it;
None reads the index’s registered one.
Implementations§
§impl InflationLinkedBond
impl InflationLinkedBond
pub fn with_interpolation(self, interpolation: IndexInterpolation) -> Self
pub fn with_interpolation(self, interpolation: IndexInterpolation) -> Self
This bond observing its index under interpolation rather than the
index’s registered convention, for every coupon’s ratio and the
redemption’s.
pub fn new(
currency: Currency,
index: impl Into<String>,
base_index: f64,
real_coupon: f64,
lag_months: u32,
frequency: Frequency,
day_count: DayCountFraction,
face: f64,
issue: NaiveDate,
maturity: NaiveDate,
) -> Result<Self, CurveError>
pub fn new( currency: Currency, index: impl Into<String>, base_index: f64, real_coupon: f64, lag_months: u32, frequency: Frequency, day_count: DayCountFraction, face: f64, issue: NaiveDate, maturity: NaiveDate, ) -> Result<Self, CurveError>
A capital-indexed, par-floored linker on index — the TIPS shape —
collateralised in its own currency.
§Errors
CurveError::Malformed if the real bullet cannot be built.
pub fn with_redemption_floor(self, floored: bool) -> Self
pub fn with_redemption_floor(self, floored: bool) -> Self
Sets whether each principal payment is floored at par: the redemption at maturity, and every paydown of an amortising real twin.
pub fn with_amortisation(
self,
outstanding: Vec<f64>,
) -> Result<Self, CurveError>
pub fn with_amortisation( self, outstanding: Vec<f64>, ) -> Result<Self, CurveError>
This linker with its real twin paying principal down on outstanding,
one fraction of the original face per coupon period, as
FixedRateBond::with_amortisation takes it. Each paydown is indexed
at its period’s ratio, as the coupons are.
§Errors
The real twin’s refusal of a malformed profile.
pub fn with_payment_calendar(
self,
calendar: Arc<dyn Calendar>,
convention: BusinessDayConvention,
) -> Self
pub fn with_payment_calendar( self, calendar: Arc<dyn Calendar>, convention: BusinessDayConvention, ) -> Self
This linker paying on calendar under convention, by forwarding to
its real twin’s
with_payment_calendar.
Only the date each flow is paid and discounted on rolls. The accrual does not move, and neither does the index observation, which is read at the accrual end — a coupon that settles two days late for a holiday pays the same indexed amount.
pub fn with_accrual_adjustment(
self,
calendar: Arc<dyn Calendar>,
convention: BusinessDayConvention,
) -> Self
pub fn with_accrual_adjustment( self, calendar: Arc<dyn Calendar>, convention: BusinessDayConvention, ) -> Self
This linker accruing over boundaries rolled on calendar under
convention, by forwarding to its real twin’s
with_accrual_adjustment.
Each flow’s index
observation is read at its rolled accrual end. Set it before
with_amortisation.
pub fn issued_by(self, issuer: CreditCurveId) -> Self
pub fn issued_by(self, issuer: CreditCurveId) -> Self
Tags the bond to issuer’s credit.
pub fn spread_by(self, key: impl Into<String>) -> Self
pub fn spread_by(self, key: impl Into<String>) -> Self
Composes the security spread under key onto the discounting.
pub fn lagged(&self, date: NaiveDate) -> NaiveDate
pub fn lagged(&self, date: NaiveDate) -> NaiveDate
The date whose index level a flow on date is scaled by: date less
the indexation lag, in whole months.
This is the pricing observation. It is what a linker’s cashflows are actually scaled by, and it reads no market quote convention — a bond’s value does not depend on the market its quote is expressed in.
The street counterpart is
linker::reference_index, which most
markets read daily-interpolated inside the month and then round by their
own published chain. The two are different rules answering different
questions, and they may legitimately disagree.
§Panics
If the date arithmetic overflows, which no bond’s dates do.
§impl InflationLinkedBond
impl InflationLinkedBond
pub fn index_ratio<R: Scalar>(
&self,
view: &PricingView<'_, R>,
date: NaiveDate,
) -> Result<R, PricingError>
pub fn index_ratio<R: Scalar>( &self, view: &PricingView<'_, R>, date: NaiveDate, ) -> Result<R, PricingError>
The index ratio applied to a flow paying at date: the level at the
lagged observation — a published fixing first, the curve otherwise —
over the base index.
§Errors
The product error if the view carries no inflation curve; otherwise whatever the curve reports.
fn indexed_flows<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<Vec<(NaiveDate, R)>, PricingError>
fn indexed_flows<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<Vec<(NaiveDate, R)>, PricingError>
The indexed flows after the valuation: each real coupon scaled by its ratio, the redemption scaled or — when the floor binds — returned as the par amount unmultiplied, so the kink carries a one-sided derivative and no spurious index sensitivity.
Trait Implementations§
§impl Clone for InflationLinkedBond
impl Clone for InflationLinkedBond
§fn clone(&self) -> InflationLinkedBond
fn clone(&self) -> InflationLinkedBond
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 InflationLinkedBond
impl Debug for InflationLinkedBond
§impl PartialEq for InflationLinkedBond
impl PartialEq for InflationLinkedBond
§fn eq(&self, other: &InflationLinkedBond) -> bool
fn eq(&self, other: &InflationLinkedBond) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for InflationLinkedBond
impl<R: Scalar> Priceable<R> for InflationLinkedBond
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The indexed flows discounted on the collateral curve; survival-weighted on the current indexed face when tagged.
§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 InflationLinkedBond
impl PricingRiskFactors for InflationLinkedBond
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
§impl Product for InflationLinkedBond
impl Product for InflationLinkedBond
§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.