pub struct CoherenceForecaster { /* private fields */ }Expand description
Coherence forecaster using exponential smoothing methods
Implementations§
Source§impl CoherenceForecaster
impl CoherenceForecaster
Sourcepub fn new(alpha: f64, window: usize) -> Self
pub fn new(alpha: f64, window: usize) -> Self
Create a new forecaster with smoothing parameters
§Arguments
alpha- Level smoothing parameter (0.0 to 1.0). Higher = more weight on recent valueswindow- Maximum number of historical observations to keep
Sourcepub fn with_beta(self, beta: f64) -> Self
pub fn with_beta(self, beta: f64) -> Self
Create a forecaster with custom trend smoothing parameter
Sourcepub fn add_observation(&mut self, timestamp: DateTime<Utc>, value: f64)
pub fn add_observation(&mut self, timestamp: DateTime<Utc>, value: f64)
Add a new observation to the forecaster
Sourcepub fn detect_regime_change_probability(&self) -> f64
pub fn detect_regime_change_probability(&self) -> f64
Detect probability of regime change using CUSUM statistics
§Returns
Probability between 0.0 and 1.0 that a regime change is occurring
Sourcepub fn get_trend_value(&self) -> Option<f64>
pub fn get_trend_value(&self) -> Option<f64>
Get the smoothed trend value
Auto Trait Implementations§
impl Freeze for CoherenceForecaster
impl RefUnwindSafe for CoherenceForecaster
impl Send for CoherenceForecaster
impl Sync for CoherenceForecaster
impl Unpin for CoherenceForecaster
impl UnwindSafe for CoherenceForecaster
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more