pub struct PageHinkleyDetector { /* private fields */ }Expand description
Page-Hinkley change-point detector (one-sided, detects increases).
Simpler alternative to CUSUM. Tracks the cumulative deviation from the running mean and alarms when it exceeds a threshold.
§Algorithm
m_t = sum_{i=1}^t (x_i - mean_t - delta) M_t = min_{1<=i<=t} m_i Alarm when m_t - M_t > lambda
Implementations§
Source§impl PageHinkleyDetector
impl PageHinkleyDetector
Sourcepub fn new(delta: f64, lambda: f64) -> Self
pub fn new(delta: f64, lambda: f64) -> Self
Create a Page-Hinkley detector.
§Parameters
delta: Allowance parameter (tolerance for drift)lambda: Detection threshold
Sourcepub fn update(&mut self, value: f64) -> bool
pub fn update(&mut self, value: f64) -> bool
Feed one observation. Returns true if alarm fires.
Sourcepub fn alarm_count(&self) -> u64
pub fn alarm_count(&self) -> u64
Total alarms fired.
Trait Implementations§
Source§impl Clone for PageHinkleyDetector
impl Clone for PageHinkleyDetector
Source§fn clone(&self) -> PageHinkleyDetector
fn clone(&self) -> PageHinkleyDetector
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 moreAuto Trait Implementations§
impl Freeze for PageHinkleyDetector
impl RefUnwindSafe for PageHinkleyDetector
impl Send for PageHinkleyDetector
impl Sync for PageHinkleyDetector
impl Unpin for PageHinkleyDetector
impl UnsafeUnpin for PageHinkleyDetector
impl UnwindSafe for PageHinkleyDetector
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<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