Struct StepForward
pub struct StepForward {
inner: PiecewiseDiscount,
knots: Vec<KnotKind>,
}Expand description
A piecewise curve whose pillars are dated by central-bank meetings and turn-of-period jumps rather than by tenor.
Evaluation is identical to PiecewiseDiscount — log-linear between
pillars, which is a piecewise-constant forward, which is what makes a step
curve a step curve. What differs is identity: each pillar knows whether
it is a meeting, a turn, or an ordinary node, so risk read-back can key its
adjoint by the event rather than by a date.
That identity lives here, on the storage, and not on the evaluation trait: the evaluation trait says only what a curve is, and how risk is labelled is a property of the lift.
Fields§
§inner: PiecewiseDiscount§knots: Vec<KnotKind>One entry per free pillar, index-aligned with the inner curve’s.
Implementations§
§impl StepForward
impl StepForward
pub fn from_discount_factors(
reference_date: NaiveDate,
knots: &[(NaiveDate, KnotKind)],
discount_factors: &[f64],
) -> Result<Self, CurveError>
pub fn from_discount_factors( reference_date: NaiveDate, knots: &[(NaiveDate, KnotKind)], discount_factors: &[f64], ) -> Result<Self, CurveError>
Builds a step curve from knotted pillar dates and their discount factors.
§Errors
CurveError::Malformed if the inputs disagree in length, or if the
inner curve rejects the pillars.
pub fn knot_kinds(&self) -> &[KnotKind]
pub fn knot_kinds(&self) -> &[KnotKind]
What each free pillar is: a meeting, a turn, or an ordinary node.
pub fn pillar_dates(&self) -> &[NaiveDate]
pub fn pillar_dates(&self) -> &[NaiveDate]
The knot dates, index-aligned with knot_kinds.
A risk read-back needs both: the kind decides which key a pillar reports under, and an anonymous knot still reports its date.
pub fn interpolation(&self) -> Interpolation
pub fn interpolation(&self) -> Interpolation
The scheme the inner curve interpolates under.
pub fn parameters(&self) -> &[f64]
pub fn parameters(&self) -> &[f64]
The stored parameters — log discount factors at the knots.
pub(crate) fn view_with_slice<'a, R: Scalar>(
&'a self,
rest: &mut &'a [R],
) -> StepView<'a, R>
pub(crate) fn view_with_slice<'a, R: Scalar>( &'a self, rest: &mut &'a [R], ) -> StepView<'a, R>
One step of a substituted walk. See
take_params.
Trait Implementations§
§impl Clone for StepForward
impl Clone for StepForward
§fn clone(&self) -> StepForward
fn clone(&self) -> StepForward
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more