pub struct HoltLinear { /* private fields */ }Expand description
Holt’s Linear Exponential Smoothing.
Implementations§
Source§impl HoltLinear
impl HoltLinear
Sourcepub fn new(alpha: f64, beta: f64) -> Option<Self>
pub fn new(alpha: f64, beta: f64) -> Option<Self>
Creates a new Holt smoother.
§Parameters
alpha: level smoothing constant ∈ (0, 1)beta: trend smoothing constant ∈ (0, 1)
Returns None if parameters are out of range.
Sourcepub fn smooth(&self, data: &[f64]) -> Option<HoltResult>
pub fn smooth(&self, data: &[f64]) -> Option<HoltResult>
Applies Holt’s linear smoothing to the data.
Requires at least 2 data points.
Returns None if data has fewer than 2 points.
Auto Trait Implementations§
impl Freeze for HoltLinear
impl RefUnwindSafe for HoltLinear
impl Send for HoltLinear
impl Sync for HoltLinear
impl Unpin for HoltLinear
impl UnwindSafe for HoltLinear
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