Outlier Fences and Rule Checks

Outlier Fences and Rule Checks

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

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

Outlier Fences and Rule Checks

The chapter fences outliers with an IQR rule — quartiles 21 and 24 give bounds of [16.5, 28.5] that flag a suspect 85 — and quarantines a 45.0 C HVAC spike that jumps 22.8 C/s past a 0.5 C/s limit. A validation rule is only as good as the boundary number it computes. This audit reproduces the outlier fences and rule checks so a later reviewer can prove each rejection was correct.

Companion to the chapter Validation and Outlier Detection — every number here comes from that chapter.

See the relationship before changing it

Set the input, apply the rule, then read the result with its unit.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 1.5.

  2. 2

    Name the relationship. upper fence = Q3 + multiplier x (Q3 - Q1)

  3. 3

    Substitute with units. 24 + 1.5 x (24 - 21) = 28.50 C

  4. 4

    Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.

Predict, then change iqr multiplier

Try Predict the direction of upper fence = Q3 + multiplier x (Q3 - Q1). Test another iqr multiplier, then compare upper fence.

1.5
Chapter baseline
Upper fence

Observe A wider multiplier admits more values. It does not prove that an admitted value is correct. Reset iqr multiplier to 1.5 and compare upper fence.

Explain The outlier fence sits a chosen number of interquartile ranges above the upper quartile, so increasing that multiplier raises the acceptance limit linearly.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only iqr multiplier moves here. Field effects named in the technical boundary stay fixed.
Try

The chapter fences outliers with an IQR rule — quartiles 21 and 24 give bounds of [16.5, 28.5] that flag a suspect 85 — and quarantines a 45.0 C HVAC spike that jumps 22.8 C/s past a 0.5 C/s limit. Calculate this case.

Observe

This audit reproduces the outlier fences and rule checks so a later reviewer can prove each rejection was correct. Check shows this.

Explain

The audit conclusion is narrow: the fence [16.5, 28.5] and the 0.5 C/s and 3 C limits are all reproducible from stated inputs, and that is the point. When the rule version and these boundary numbers travel with each rejected sample, a later reviewer can prove the quarantine was correct rather than trusting that something merely looked wrong. Check confirms it.

Technical boundaries

The upper fence keeps the lower and upper quartiles at 21 and 24 C while the multiplier changes. It does not account for time dependence, anomalies across several variables, distribution changes, why readings are missing, calibration, or the cost of false alarms.

Ada: A validation rule is only as good as the boundary number it computes, so let me reproduce the two worked examples above exactly. A fence that is off by a little quietly accepts bad data or rejects good data.

The IQR outlier bound uses the window with quartiles Q1 = 21 and Q3 = 24:

  • Interquartile range: IQR = Q3 - Q1 = 24 - 21 = 3
  • Fence half-width: 1.5 x IQR = 1.5 x 3 = 4.5
  • Lower fence: Q1 - 4.5 = 21 - 4.5 = 16.5
  • Upper fence: Q3 + 4.5 = 24 + 4.5 = 28.5
  • The suspect value 85 is outside [16.5, 28.5], so it is flagged, not silently dropped.

The HVAC example applies hard rules to a 45.0 C sample that arrives one second after a 22.2 C reading, with a peer sensor reading 22.4 C:

  • Rate of change: |45.0 - 22.2| / 1 s = 22.8 / 1 = 22.8 C/s, far above the 0.5 C/s limit (22.8 / 0.5 = 45.6x over).
  • Peer difference: |45.0 - 22.4| = 22.6 C, far above the 3 C tolerance.
  • The sample fails operating-range, rate-of-change, and peer checks together, so it is quarantined while control keeps the last valid value.

The audit conclusion is narrow: the fence [16.5, 28.5] and the 0.5 C/s and 3 C limits are all reproducible from stated inputs, and that is the point. When the rule version and these boundary numbers travel with each rejected sample, a later reviewer can prove the quarantine was correct rather than trusting that something merely looked wrong.

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