pub struct FlatExtrapolator;Expand description
Flat extrapolation - constant value from the last point.
This is the simplest extrapolation method, maintaining a constant value equal to the last observed point. It implies a flat forward rate curve beyond the last liquid point.
§Properties
- Simple: No parameters to configure
- Conservative: No trend assumptions
- Discontinuous derivative: Slope becomes zero at boundary
§Use Cases
- Short-term extrapolation where trend continuation is not desired
- Conservative scenarios
- Default fallback when no better method is available
§Example
use convex_math::extrapolation::{FlatExtrapolator, Extrapolator};
let extrap = FlatExtrapolator;
// Last observed: 5% at 10 years with 0.1% slope
let rate = extrap.extrapolate(15.0, 10.0, 0.05, 0.001);
assert_eq!(rate, 0.05); // Same as last valueImplementations§
Trait Implementations§
Source§impl Clone for FlatExtrapolator
impl Clone for FlatExtrapolator
Source§fn clone(&self) -> FlatExtrapolator
fn clone(&self) -> FlatExtrapolator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FlatExtrapolator
impl Debug for FlatExtrapolator
Source§impl Default for FlatExtrapolator
impl Default for FlatExtrapolator
Source§fn default() -> FlatExtrapolator
fn default() -> FlatExtrapolator
Returns the “default value” for a type. Read more
Source§impl Extrapolator for FlatExtrapolator
impl Extrapolator for FlatExtrapolator
impl Copy for FlatExtrapolator
Auto Trait Implementations§
impl Freeze for FlatExtrapolator
impl RefUnwindSafe for FlatExtrapolator
impl Send for FlatExtrapolator
impl Sync for FlatExtrapolator
impl Unpin for FlatExtrapolator
impl UnwindSafe for FlatExtrapolator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.