AI Glossary / Statistics and probability / Advanced

Inner fences

Definition

Inner fences are reference boundaries used in a common boxplot rule to flag unusually low or high observations. The lower fence is the lower quartile minus 1.5 times the interquartile range; the upper fence is the upper quartile plus 1.5 times that range. In Tukey-style terminology, the corresponding quantities are hinges and their H-spread.

What it means

The fences describe how far an observation lies beyond the central portion of a dataset. They provide a starting point for investigating unusual values.
A flagged value is not automatically an error. It may represent a genuine rare event, a different subgroup, or an ordinary observation from a skewed distribution. The rule is exploratory: a fence is not a confidence limit, a physical constraint, or a contractual performance threshold.

How it works

Sort the observations and calculate the lower and upper quartiles using a stated convention. Subtract the lower quartile from the upper to obtain the interquartile range, or IQR. Multiply the IQR by 1.5, subtract the result from the lower quartile, and add it to the upper quartile.
Using the convention in this entry, observations strictly outside those boundaries are flagged; a value exactly on a fence remains inside. In a modified boxplot, whiskers typically end at the most extreme observed values still inside the fences. These endpoints are actual data values, whereas fences are calculated boundaries and need not occur in the dataset.
Quartile and hinge definitions can differ between implementations, especially for small samples. Record the method when exact flags matter.

Three practical examples

  • An analyst screens response times for unusually slow requests. Flagged cases are investigated for workload or logging explanations before any exclusion is considered.
  • A data-quality team examines sensor readings that lie beyond a batch's fences. It checks units and instrument records to distinguish measurement errors from genuine operating events.
  • A model evaluator compares error distributions across categories using boxplots. Separate fences summarize each category, but do not establish that every category meets the same absolute performance standard.

Think of it this way

Imagine drawing guide lines beyond the main crowd in a photograph. People outside the lines attract attention, but the lines do not prove they are in the wrong place. They help organize inspection rather than decide which people should be erased.

Worked example

Take twelve invented measurements in increasing order: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 30. Use the median-of-halves convention: find the median of the lower six and the median of the upper six.
The lower quartile is (3 plus 4)/2 = 3.5. The upper quartile is (9 plus 10)/2 = 9.5. Their difference is 6, so 1.5 times the IQR is 9.
The lower inner fence is 3.5 minus 9 = minus 5.5. The upper inner fence is 9.5 plus 9 = 18.5. Only 30 lies outside these boundaries. The minimum observed value, 1, lies inside even though the lower boundary is negative.
The lower whisker ends at 1 and the upper whisker at 11 under the stated modified-boxplot rule. Neither whisker needs to reach the numerical fence. The value 30 is displayed separately rather than extending the upper whisker to 30.
For comparison, outer fences use three times the IQR. Here they are minus 14.5 and 27.5. The value 30 is beyond the upper outer fence as well. This extra classification does not determine whether the measurement is valid.
Now replace 30 with 18. The median-of-halves quartiles remain 3.5 and 9.5 because the central positions within the halves are unchanged. The upper fence remains 18.5, so 18 is not flagged.
A different quartile algorithm can change that conclusion. With linear interpolation at position 1 plus (n minus 1) times p, the quartile positions for twelve observations are 3.75 and 9.25. On this dataset, the quartiles are therefore 3.75 and 9.25. The IQR is 5.5, making the fences minus 4.5 and 17.5. Under this convention, the value 18 is flagged.
This is not an arithmetic contradiction. The two calculations use different definitions of sample quartiles. Reports should identify the convention and avoid silently switching methods.
Finally, multiplying every measurement by ten multiplies both quartiles, the IQR, and the fences by ten. The flagging decisions remain unchanged under that positive rescaling. A nonlinear transformation, such as taking logarithms, need not preserve the same flags and should be treated as a different analysis.

Illustrative case study

Fictional company Birch Monitoring adds boxplot flags to an operational dashboard. An unusually large reading is highlighted, and the analyst checks its original record. The reading turns out to belong to a demanding but valid operating condition.
The team retains the value and investigates whether that condition should be summarized separately. It also documents the quartile algorithm so that the dashboard and exported analysis agree. The fence helps direct attention; it does not replace a decision about data validity or operational acceptability. This scenario is fictional.

Common misconceptions and mistakes

Inner fences are not the same as whisker endpoints. A fence may fall where no observation exists.
The multiplier is 1.5 times the IQR, not 1.5 times the standard deviation or median.
A negative lower fence does not imply that a nonnegative quantity can physically become negative. It is simply the calculated exploratory boundary.
Deleting every flagged observation can remove precisely the rare events an analysis needs to understand.
If the IQR is zero, both fences collapse to the common quartile value. This can happen with heavily tied data and calls for careful interpretation rather than automatic rejection of every different value.

Business use

Use inner fences to prioritize investigation and communicate distributional spread. Preserve original observations and record reasons for corrections or exclusions. For monitoring, distinguish fences estimated from a fixed reference period from fences recalculated on each new batch. A changing statistical boundary and a fixed business requirement answer different questions.

People also ask

Must the data be normal?

The calculation does not require normality, but the distribution affects how many observations it flags.

Is every point outside a fence incorrect?

No.

Why do software packages sometimes disagree?

Quartile, hinge, and boundary conventions may differ.

Check your understanding

What are the first example's inner fences?

Answer: Minus 5.5 and 18.5.

Why is the upper whisker at 11?

Answer: It is the largest observed value within the fences.

Why can 18 be flagged under one calculation but not another?

Answer: The quartile algorithms produce different boundaries.

Related terms

  • Quartile
  • H-spread
  • Adjacent values
  • Outlier
  • Boxplot
  • hinge
  • interquartile range
  • adjacent value
  • outer fence

Learn next

Compare quartile algorithms, robust summaries, and graphical investigation of skewed or mixed distributions. Study why exploratory flags differ from formal outlier tests.

  • Quartile
  • Outlier

More in Statistics and probability

  • Information bottleneck method - The information bottleneck method seeks a representation of an input that retains information relevant to a chosen target while discarding other input detail.
  • Information field theory - Information field theory is a Bayesian framework for inferring fields from incomplete or noisy measurements.
  • Information matrix test - The information matrix test checks a likelihood model by comparing two quantities that agree in expectation under correct specification and suitable...
  • Instrumental variables - Instrumental variables are variables used to isolate variation in an explanatory variable that can support causal estimation despite endogeneity.
  • Intensive sampling - Intensive sampling concentrates observation effort within a limited area or a narrow subject range.
  • Intention-to-treat - Intention-to-treat is the principle of analyzing participants according to their original randomized assignment, including those who did not follow the...

Sources

Howell, Statistical Methods for Psychology glossary, Inner fences and Adjacent values: https://www.uvm.edu/~statdhtx/methods8/Glossary/Glossary.html . NIST/SEMATECH, Box Plot: https://www.itl.nist.gov/div898/handbook/eda/section3/boxplot.htm . R documentation, Sample Quantiles: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/quantile.html . Measurements and company scenario are original illustrations.

Previous: Initial state Next: Inner product

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer