Struct InterpolatedStub
pub struct InterpolatedStub {
pub shorter: StubTenor,
pub longer: StubTenor,
pub weight: f64,
}Expand description
ISDA 2006 §8.3 Linear Interpolation for a stub whose confirmation elects
it: the rate is R_short + weight · (R_long − R_short), each rate read
from the store where published and otherwise projected over its own
window off its own index’s curve.
weight is (D_stub − D_short) / (D_long − D_short) in days, fixed when
the coupon is built, and lies in [0, 1]: §8.3 interpolates between the
tenors either side of the stub and does not extrapolate.
Fields§
§shorter: StubTenorThe Designated Maturity next shorter than the stub.
longer: StubTenorThe Designated Maturity next longer than the stub.
weight: f64The day-count weight on the longer tenor’s rate.
Implementations§
§impl InterpolatedStub
impl InterpolatedStub
pub(crate) fn index_rate<R: Scalar, C: CurveByIndex<R> + ?Sized>(
&self,
fixing_date: Option<NaiveDate>,
curves: &C,
fixings: &FixingsView<'_, R>,
as_of: NaiveDate,
) -> Result<R, CashflowError>
pub(crate) fn index_rate<R: Scalar, C: CurveByIndex<R> + ?Sized>( &self, fixing_date: Option<NaiveDate>, curves: &C, fixings: &FixingsView<'_, R>, as_of: NaiveDate, ) -> Result<R, CashflowError>
The blended index rate, before gearing and spread, for a stub fixing
on fixing_date: R_short + weight · (R_long − R_short), each tenor
read from the store where published and otherwise projected over its
own window off its own index’s curve.
§Errors
CashflowError::InterpolatedStubOnOneCurve where curves is one
curve standing in for every index; CashflowError::NoCurveForIndex
naming a tenor whose curve it does not hold; a missing historical
print or a curve query as for any reset.
pub(crate) fn on_one_curve(&self) -> CashflowError
pub(crate) fn on_one_curve(&self) -> CashflowError
The refusal of a one-curve valuation, naming the two tenors.
Trait Implementations§
§impl Clone for InterpolatedStub
impl Clone for InterpolatedStub
§fn clone(&self) -> InterpolatedStub
fn clone(&self) -> InterpolatedStub
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 InterpolatedStub
impl Debug for InterpolatedStub
§impl PartialEq for InterpolatedStub
impl PartialEq for InterpolatedStub
§fn eq(&self, other: &InterpolatedStub) -> bool
fn eq(&self, other: &InterpolatedStub) -> bool
self and other values to be equal, and is used by ==.