pub struct HoltWinters { /* private fields */ }Expand description
Holt-Winters Triple Exponential Smoothing.
Implementations§
Source§impl HoltWinters
impl HoltWinters
Sourcepub fn new(
alpha: f64,
beta: f64,
gamma: f64,
period: usize,
seasonality: Seasonality,
) -> Option<Self>
pub fn new( alpha: f64, beta: f64, gamma: f64, period: usize, seasonality: Seasonality, ) -> Option<Self>
Creates a new Holt-Winters smoother.
§Parameters
alpha: level smoothing constant ∈ (0, 1)beta: trend smoothing constant ∈ (0, 1)gamma: seasonal smoothing constant ∈ (0, 1)period: seasonal period (must be ≥ 2)seasonality: additive or multiplicative
Returns None if parameters are invalid.
Sourcepub fn seasonality(&self) -> Seasonality
pub fn seasonality(&self) -> Seasonality
Returns the seasonality type.
Sourcepub fn smooth(&self, data: &[f64]) -> Option<HoltWintersResult>
pub fn smooth(&self, data: &[f64]) -> Option<HoltWintersResult>
Applies Holt-Winters smoothing to the data.
Requires at least 2 * period data points for initialization.
Returns None if data is insufficient or if multiplicative
seasonality is used with non-positive data.
Auto Trait Implementations§
impl Freeze for HoltWinters
impl RefUnwindSafe for HoltWinters
impl Send for HoltWinters
impl Sync for HoltWinters
impl Unpin for HoltWinters
impl UnwindSafe for HoltWinters
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