Skip to main content

StageResult

Struct StageResult 

Source
pub struct StageResult {
    pub label: &'static str,
    pub n_obs: u32,
    pub n_calm_obs: u32,
    pub n_false_alarms: u32,
    pub n_detections: u32,
    pub first_detection_k: Option<u32>,
    pub lambda_at_detection: Option<f32>,
    pub lambda_event_peak: f32,
    pub ground_truth_onset_k: u32,
}
Expand description

Detection statistics for one stage of the Continuous Rigor pipeline.

Populated by the per-stage loops in each example.

Fields§

§label: &'static str

Human-readable stage label (e.g. "Stage I: Physics Baseline").

§n_obs: u32

Total observations processed in this stage (including calibration).

§n_calm_obs: u32

Observations in the “calm” pre-event segment (for FA counting).

§n_false_alarms: u32

Policy::Review or Policy::Escalate events in the calm segment (false alarms).

§n_detections: u32

Policy::Review or Policy::Escalate events in the event / post-onset segment (detections).

§first_detection_k: Option<u32>

Sample index k of the first detection (None if no detection).

§lambda_at_detection: Option<f32>

Lyapunov exponent λ at the first detection (None if no detection).

§lambda_event_peak: f32

Maximum |λ| observed in the event segment.

§ground_truth_onset_k: u32

Ground-truth onset sample index (from SigMF annotation or scenario model).

Implementations§

Source§

impl StageResult

Source

pub const fn new(label: &'static str, ground_truth_onset_k: u32) -> Self

Construct a zeroed-out result with a label and ground-truth onset.

Source

pub fn false_alarm_rate(&self) -> f32

False-alarm rate: n_false_alarms / n_calm_obs.

Returns 0.0 if no calm observations.

Source

pub fn lead_time_samples(&self) -> Option<i32>

Lead-time advantage in samples: ground_truth − first_detection.

Positive → DSFB detected BEFORE the ground-truth reference time. Negative → DSFB detected AFTER (degraded performance or late onset). Returns None if no detection was made.

Source

pub fn lead_time_ms(&self, sample_rate_hz: f32) -> Option<f32>

Lead-time expressed as milliseconds, given the sample rate in Hz.

Source

pub fn meets_1e5_fa_threshold(&self) -> bool

Whether this stage meets the SBIR 10⁻⁵ false-alarm threshold.

At a calm segment of N observations, FA rate < 10⁻⁵ requires < N/10⁵ false alarms. This method uses the observed rate as a proxy. Formal FA validation requires large-N Monte Carlo beyond what a single pipeline run provides — see paper §L5 for caveat.

Trait Implementations§

Source§

impl Clone for StageResult

Source§

fn clone(&self) -> StageResult

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StageResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for StageResult

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.