pub struct SequentialConfig {
pub m: usize,
pub detector: Detector,
pub error_type: ForecastErrorType,
pub gamma: f64,
pub alpha: f64,
pub critical_value: CriticalValue,
pub sigma2: Option<f64>,
}Expand description
Configuration for a SequentialDetector.
Fields§
§m: usizeLength of the training window (the first m errors are assumed
changepoint-free and define the baseline mean/variance).
detector: DetectorWhich CUSUM detector to use. Default: PageCusum.
error_type: ForecastErrorTypeWhich error transformation(s) to monitor. Default: Both.
gamma: f64Weight-function tuning parameter, 0 ≤ γ < 0.5. Default: 0.0.
alpha: f64Nominal type-I error rate in (0, 1). Default: 0.05.
critical_value: CriticalValueHow to obtain the critical value. Default: Lookup (consult the
baked table; fall through to simulation when off-grid).
sigma2: Option<f64>Optional override for the training-window variance.
R uses var(X[1:m]) which assumes independence. For autocorrelated
residuals, pass a long-run variance estimate via
SequentialConfig::with_sigma2.
Implementations§
Source§impl SequentialConfig
impl SequentialConfig
Sourcepub fn error_type(self, error_type: ForecastErrorType) -> Self
pub fn error_type(self, error_type: ForecastErrorType) -> Self
Set the error transformation.
Sourcepub fn critical_value(self, cv: CriticalValue) -> Self
pub fn critical_value(self, cv: CriticalValue) -> Self
Set how the critical value is obtained.
Sourcepub fn with_sigma2(self, sigma2: f64) -> Self
pub fn with_sigma2(self, sigma2: f64) -> Self
Override the training-window variance.
Use this when the forecast-error series has non-trivial autocorrelation and you have a long-run variance estimate (Newey–West, HAC, etc.).
Trait Implementations§
Source§impl Clone for SequentialConfig
impl Clone for SequentialConfig
Source§impl Debug for SequentialConfig
impl Debug for SequentialConfig
Auto Trait Implementations§
impl Forget for SequentialConfig
impl Freeze for SequentialConfig
impl Move for SequentialConfig
impl RefUnwindSafe for SequentialConfig
impl Send for SequentialConfig
impl Sync for SequentialConfig
impl Unpin for SequentialConfig
impl UnsafeUnpin for SequentialConfig
impl UnwindSafe for SequentialConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.