1.19 Descriptive statistics and distribution shape
Standard probability and statistics for ML — written August 2026
What this is and why it exists
Before any model touches a dataset, someone must look at it — and looking is a skill with instruments. This topic is the instrument panel: summaries that resist being fooled, plots that expose shape, and the standing rule that a mean quoted without its distribution is a rumour.
The vocabulary
- Mean / median / mode — balance point, middle value, most common value; three "centres" that disagree exactly when it matters.
- Standard deviation / IQR — spread by average squared distance, and spread by the middle 50%'s width; the second shrugs at outliers.
- Quantiles — the sorted data read by fractions: quartiles, percentiles (pr2's quantile, now empirical).
- Boxplot — median, quartile box, whiskers, and outliers as dots: a distribution's one-line summary.
- Robust statistic — one a few wild values cannot drag: median and IQR, versus mean and standard deviation.
- Histogram — counts in bins; the distribution's actual shape, bin width permitting.
- QQ plot — sample quantiles against a theoretical distribution's: a straight line means the shape matches; curved tails confess.
The mental model
The mean is a balance point, and balance points are draggable: one billionaire in the room moves the average income by crores while the median moves not at all. That sensitivity is not a flaw — the mean feeds the CLT machinery of pr5 and st2 — but it makes the mean-median COMPARISON a free diagnostic: agreement suggests symmetry; a gap names the skew and its direction (pr3's story, read from two numbers). Salaries, latencies, city populations: right-skewed, mean above median, median the honest headline. The same split runs through spread: standard deviation squares distances, so outliers dominate it; the IQR measures the middle half and cannot be bribed. Robust statistics are the pair to reach for FIRST on unfamiliar data — switch to moment-based ones after the shape has been seen and trusted.
Then look, in order. HISTOGRAM first: shape, skew, outliers, and — the summary-killer — multiple humps. Two humps mean two populations sharing one table (two campuses, two device types), and every single-number summary of a bimodal distribution describes nobody: the mean falls in the valley between the humps. Try two or three bin widths; too few bins hide humps, too many manufacture noise. BOXPLOTS second, one per group side by side — the fastest honest comparison of several groups on one axis. QQ PLOT third, when a method assumes normality (st2's intervals, st3's tests): sample quantiles against Gaussian quantiles; a straight line blesses the assumption, and tails that peel away from the line are the heavy tails pr3 warned about, caught before they poison an error bar.
The closing rule is cheap and permanent: no summary without a look at the shape it summarises. Anscombe's famous quartet — four datasets, identical means, variances and correlations, wildly different pictures — is the ten-minute demonstration that this rule has teeth.
What you should now be able to explain or do
Choose mean-and-SD versus median-and-IQR for a stated dataset and defend it. Read skew from the mean-median gap. Spot bimodality on a histogram and say why summaries then lie. Read a QQ plot's verdict on normality. Recite Anscombe's lesson.
Check yourself
Median ₹4.2 lakh, mean ₹7.8 lakh. What is the shape, and which number belongs in the headline?
Strong right skew — a long high tail drags the mean. The median describes the typical case; the mean describes the total divided by heads, which the tail owns.
Why can a histogram invalidate every summary statistic at once?
Two humps: the data is two populations mixed. Any single centre or spread describes the mixture — often a value near the empty valley where almost nobody sits.
What makes the IQR robust where the standard deviation is not?
The IQR is the width of the middle 50% — moving the extreme values anywhere changes nothing. The SD squares every distance, so the wildest points dominate it.
On a QQ plot against the normal, the points lie straight in the middle and bend up at the right end. Verdict?
The bulk is normal-ish but the right tail is heavier than Gaussian — large values occur more than the bell predicts. Normality-assuming error bars will understate extremes.
What is Anscombe's quartet a proof of?
That identical means, variances and correlations can describe four utterly different datasets — summaries without plots are rumours.
Go deeper
We haven't checked most of these for screen reader use yet.
Back to Descriptive statistics and distribution shape: work through the checklist