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 strHuman-readable stage label (e.g. "Stage I: Physics Baseline").
n_obs: u32Total observations processed in this stage (including calibration).
n_calm_obs: u32Observations in the “calm” pre-event segment (for FA counting).
n_false_alarms: u32Policy::Review or Policy::Escalate events in the calm segment (false alarms).
n_detections: u32Policy::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: f32Maximum |λ| observed in the event segment.
ground_truth_onset_k: u32Ground-truth onset sample index (from SigMF annotation or scenario model).
Implementations§
Source§impl StageResult
impl StageResult
Sourcepub const fn new(label: &'static str, ground_truth_onset_k: u32) -> Self
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.
Sourcepub fn false_alarm_rate(&self) -> f32
pub fn false_alarm_rate(&self) -> f32
False-alarm rate: n_false_alarms / n_calm_obs.
Returns 0.0 if no calm observations.
Sourcepub fn lead_time_samples(&self) -> Option<i32>
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.
Sourcepub fn lead_time_ms(&self, sample_rate_hz: f32) -> Option<f32>
pub fn lead_time_ms(&self, sample_rate_hz: f32) -> Option<f32>
Lead-time expressed as milliseconds, given the sample rate in Hz.
Sourcepub fn meets_1e5_fa_threshold(&self) -> bool
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
impl Clone for StageResult
Source§fn clone(&self) -> StageResult
fn clone(&self) -> StageResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more