pub struct RegimeShiftConfig {
pub enabled: bool,
pub cusum_k: f64,
pub cusum_h: f64,
pub bocpd_lambda: f64,
pub bocpd_threshold: f64,
pub bocpd_max_run_length: usize,
}Expand description
Configuration for CUSUM/BOCPD regime-shift detection that augments the simple sliding-window counting in the budget controller.
When enabled, the detector runs alongside the existing signal-count logic and can trigger fallback before the count threshold is reached if a statistically significant regime change is detected.
Fields§
§enabled: boolMaster switch — when false the detector is a no-op and the budget controller falls back to pure signal counting.
cusum_k: f64CUSUM allowance parameter k. Determines how much the observed
inter-arrival rate may deviate from baseline before the cumulative
sum accumulates. Expressed in multiples of baseline sigma.
Lower → more sensitive, higher → fewer false positives.
cusum_h: f64CUSUM decision threshold h. When the cumulative sum exceeds this
value a regime shift is declared. Expressed in multiples of baseline
sigma.
bocpd_lambda: f64BOCPD hazard constant lambda — the prior expected run length
between change points (in number of observations). Smaller → more
sensitive.
bocpd_threshold: f64Posterior probability threshold for BOCPD. When the probability that the current run length is 0 (= a change just happened) exceeds this value the detector fires.
bocpd_max_run_length: usizeMaximum run-length horizon tracked by BOCPD to bound memory/CPU. Older run lengths are pruned each tick.
Implementations§
Source§impl RegimeShiftConfig
impl RegimeShiftConfig
Sourcepub const fn for_tier(tier: ExtensionBudgetTier) -> Self
pub const fn for_tier(tier: ExtensionBudgetTier) -> Self
Tier-specific defaults. Strict tiers are more sensitive (lower h, lower lambda) so regime shifts are detected faster at the cost of more false positives.
Trait Implementations§
Source§impl Clone for RegimeShiftConfig
impl Clone for RegimeShiftConfig
Source§fn clone(&self) -> RegimeShiftConfig
fn clone(&self) -> RegimeShiftConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RegimeShiftConfig
impl Debug for RegimeShiftConfig
Source§impl Default for RegimeShiftConfig
impl Default for RegimeShiftConfig
Source§impl<'de> Deserialize<'de> for RegimeShiftConfigwhere
RegimeShiftConfig: Default,
impl<'de> Deserialize<'de> for RegimeShiftConfigwhere
RegimeShiftConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RegimeShiftConfig
impl PartialEq for RegimeShiftConfig
Source§impl Serialize for RegimeShiftConfig
impl Serialize for RegimeShiftConfig
impl StructuralPartialEq for RegimeShiftConfig
Auto Trait Implementations§
impl Freeze for RegimeShiftConfig
impl RefUnwindSafe for RegimeShiftConfig
impl Send for RegimeShiftConfig
impl Sync for RegimeShiftConfig
impl Unpin for RegimeShiftConfig
impl UnsafeUnpin for RegimeShiftConfig
impl UnwindSafe for RegimeShiftConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
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>
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>
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 moreSource§impl<T> ModelDump for Twhere
T: Serialize,
impl<T> ModelDump for Twhere
T: Serialize,
Source§fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
Source§fn model_dump_json(&self) -> Result<String, Error>
fn model_dump_json(&self) -> Result<String, Error>
Source§fn model_dump_json_pretty(&self) -> Result<String, Error>
fn model_dump_json_pretty(&self) -> Result<String, Error>
Source§fn model_dump_json_with_options(
&self,
options: DumpOptions,
) -> Result<String, Error>
fn model_dump_json_with_options( &self, options: DumpOptions, ) -> Result<String, Error>
Source§impl<T> ModelValidate for Twhere
T: DeserializeOwned,
impl<T> ModelValidate for Twhere
T: DeserializeOwned,
Source§fn model_validate(
input: impl Into<ValidateInput>,
options: ValidateOptions,
) -> Result<T, ValidationError>
fn model_validate( input: impl Into<ValidateInput>, options: ValidateOptions, ) -> Result<T, ValidationError>
Source§fn model_validate_json(json: &str) -> Result<Self, ValidationError>
fn model_validate_json(json: &str) -> Result<Self, ValidationError>
Source§fn model_validate_dict(
dict: HashMap<String, Value>,
) -> Result<Self, ValidationError>
fn model_validate_dict( dict: HashMap<String, Value>, ) -> Result<Self, ValidationError>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().