Ada Audits the Residual and Window Numbers

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
analytics-ml
beginner
Ada ADA · CALCULATION AUDIT

Ada Audits the Residual and Window Numbers

At weekday 02:00 a seasonal baseline forecasts 18 kW but the meter reports 31 kW, leaving a 13 kW residual against an expected ±4 kW band — and the five-minute window that should hold 10 readings has only 8. This audit asks whether the alert should judge that 13 kW residual rather than the raw 31 kW, and whether an 80%-complete window can be trusted before a two-window rule confirms at 10 minutes.

Companion to the chapter Time-Series Anomaly Methods — every number here comes from that chapter.

— residual scoring, threshold exceedance, and window completeness, ~4 minutes

Time-series scoring is subtraction, then comparison: the residual — not the raw reading — is what crosses the threshold, and it only means anything on a complete window. Every number below is one this chapter's worked example already gave.

1. The residual is observed minus expected.

At weekday 02:00 the seasonal baseline forecasts 18 kW; the meter reports 31 kW:

residual = observed − forecast = 31 − 18 = 13 kW

2. The alert compares the residual to the band, never the raw value.

The expected residual band is ±4 kW, so the candidate rule flags when the magnitude exceeds it:

|13| > 4  →  flag  |  exceedance = 13 / 4 = 3.25× the band

3. A streaming score is only trustworthy on a complete window.

A five-minute window sampled every 30 s should hold 300 / 30 readings, and a persistence rule delays the confirmed alert:

Detector question Arithmetic shown Audit result
Forecast residual (observed − expected) 31 − 18 13 kW
Threshold test (|residual| > band) |13| > 4 flag — exceeds ±4 kW
Exceedance vs the ±4 kW band 13 / 4 3.25×
Expected readings (5-min / 30-s window) 300 / 30 10 readings
Completeness when only 8 arrive 8 / 10 80% (2 missing → provisional)
Earliest confirmed alert (2-window rule) 2 × 5 min 10 minutes

What this means for your design: thresholding the raw 31 kW would judge the reading on the wrong basis, but the 13 kW residual sits 3.25× outside the ±4 kW band — an unambiguous flag for that 02:00 context. The same arithmetic is only safe on a full window: at 80% completeness the score is provisional, and a two-window persistence rule cannot confirm before 10 minutes. If the response deadline is shorter than that, an edge rule must raise a provisional alert first and attach the later context review to the same incident id.

Every number above is taken from the chapter’s own examples and re-derived step by step.