pub struct OnlineEwm { /* private fields */ }Expand description
Streaming EWM accumulator. Returned by Ewm::online.
Maintains running mean state across incremental OnlineEwm::update
calls. Initial state has nobs=0; the first update(x) seeds the
mean with x. Subsequent updates apply the standard EWM recursion
m_t = alpha * x_t + (1 - alpha) * m_{t-1}. NaN inputs are skipped
(don’t advance state); the accumulator returns None until at least
one non-NaN observation has been seen.
Per br-frankenpandas-mvynk.
Implementations§
Source§impl OnlineEwm
impl OnlineEwm
Sourcepub fn update(&mut self, value: f64) -> Option<f64>
pub fn update(&mut self, value: f64) -> Option<f64>
Feed one value into the running EWM. Returns the current mean
estimate after the update, or None if value.is_nan() and no
prior observation exists.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OnlineEwm
impl RefUnwindSafe for OnlineEwm
impl Send for OnlineEwm
impl Sync for OnlineEwm
impl Unpin for OnlineEwm
impl UnsafeUnpin for OnlineEwm
impl UnwindSafe for OnlineEwm
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