Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.The “average” robot can mislead you
Ten delivery robots finish their routes in 20, 21, 22, 22, 23, 23, 24, 25, 26 and 190 minutes. One robot got stuck. The mean time is 39.6 minutes, longer than nine of the ten robots took! The median, the middle value, is 23 minutes, much closer to what a typical robot does.
Statistics starts with describing data honestly: a typical value, how spread out the values are, and whether anything weird is going on. And always draw a picture, because very different data can share the same summary numbers.
Telemetry from a spacecraft, timing logs from a robot, or benchmark scores for a model: the first step is always to summarize and plot. A single stuck sensor or crashed run can wreck an average and hide a real problem, or create a fake one.
- 1. Which is less affected by one huge value?
- 2. Times 20, 21, 22, 190: the mean is…
- 3. Before trusting summary numbers you should…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Location
- Mean: .
- Median: the middle of the sorted data, or the average of the two middle values.
- Mode: the most frequent value.
- Trimmed mean: drop the top and bottom 10% (say), then average.
Spread
- Sample variance: . Dividing by makes it unbiased (A5.1-3). The standard deviation is .
- Quantiles: , the median, . The IQR is .
- MAD: . For normal data, and .
Shape
- Skewness: . Positive means a long right tail, and then the mean is usually above the median.
- Excess kurtosis: . Positive means heavier tails than a normal.
Pictures
- Histogram: counts in bins.
- Boxplot: quartiles, with whiskers out to 1.5 IQR and points beyond them drawn individually (Tukey, 1977).
- Scatter plot: for pairs of variables.
- Time-series plot: for sensor streams.
- 1. For normal data, IQR ≈
- 2. A long right tail usually puts the mean…
- 3. The sample variance divides by…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Robustness
The breakdown point is the fraction of data that can be made arbitrarily bad before the estimate goes arbitrarily wrong.
| Estimate | Breakdown point |
|---|---|
| mean, sd | 0 (one bad point is enough) |
| 10%-trimmed mean | 10% |
| median, MAD | 50% (the maximum possible) |
| IQR | 25% |
With 5% stuck-sensor values at 500 in data centred at 10, the mean jumps to about 33 while the median stays at 10.1 (Exercise 1).
Robust z-scores flag outliers reliably. Ordinary z-scores suffer from masking: the outliers inflate the sd and hide themselves.
Computing variance correctly
The “textbook” formula subtracts two huge, nearly equal numbers, and for data like it returns garbage. Welford’s algorithm updates the mean and the sum of squared deviations in one stable pass: , , (Welford, 1962). It’s ideal for streaming telemetry.
Choosing bins and bandwidths
- Sturges: bins. It’s fine for small but oversmooths large samples.
- Freedman–Diaconis: width . Robust, and it scales properly with .
- Kernel density estimates: . Silverman’s rule is a good default that oversmooths multimodal data.
- 1. The median's breakdown point is…
- 2. Ordinary z-scores can fail to flag many outliers because…
- 3. The Freedman–Diaconis bin width scales like…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Why the mean and the median minimize different losses
- Mean. The derivative of the squared loss, , vanishes at .
- Median. The subgradient of the absolute loss, , changes sign at the median.
Squared loss lets one far point pull the estimate without limit. Absolute loss gives each point a bounded “vote”. Huber’s loss interpolates between the two and underlies robust regression and M-estimators (Huber, 1964).
Welford is exact
By induction, if and are correct, then . Expanding gives , with . Each step involves only deviations of moderate size, so there’s no catastrophic cancellation. Chan, Golub and LeVeque (1983) give the parallel-merge version used in distributed systems.
KDE bias and variance
For smooth , and . Balancing the two gives and an error rate of . That’s slower than the parametric : the price of making no assumptions about the shape.
Exercise 3.1: Show that 1.4826·MAD estimates σ for normal data
For , the median of solves , so . Hence .
- 1. The median minimizes the sum of…
- 2. The optimal KDE bandwidth scales like…
- 3. 1.4826 = 1/Φ⁻¹(?)
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Anscombe’s quartet and spike detection in telemetry
Anscombe (1973) built four datasets with the same mean and variance of x and y, the same correlation (0.816) and the same regression line, . Plotted, they’re a clean line, a curve, a line with one outlier, and a vertical stack with one far point. Summary statistics alone can’t tell them apart, so plot first. The same holds for telemetry. Health monitoring of spacecraft and robots flags anomalies with robust statistics (median/MAD, quantile bands), because the data are full of the outliers being searched for, and classical z-scores get masked by them (Hampel, 1974; Rousseeuw and Hubert, 2011).
Descriptive statistics in AI, robotics and aerospace
- Exploratory data analysis (Tukey, 1977) comes before modelling. Look for unit errors, clipped sensors, duplicated logs and time-zone shifts before training anything.
- Benchmark reporting. Report medians and IQRs, or full distributions, over seeds for RL results, which are notoriously heavy-tailed (Henderson et al., 2018; Agarwal et al., 2021 recommend interquartile means and bootstrap intervals).
- Spacecraft telemetry monitoring. Limit checks and robust trend statistics over thousands of channels. Learned detectors such as LSTM residual thresholds still lean on robust thresholding (Hundman et al., 2018).
- Latency budgets for robots. Control loops care about the 99th-percentile delay, not the mean. Quantiles are the right summary of a real-time system.
- Streaming statistics. Welford/Chan updates and quantile sketches (t-digest) summarize data that can’t be stored.
References
- J. Tukey (1977). Exploratory Data Analysis. Addison-Wesley.
- F. Anscombe (1973). “Graphs in statistical analysis.” The American Statistician, 27(1).
- P. Huber (1964). “Robust estimation of a location parameter.” Annals of Mathematical Statistics, 35(1).
- F. Hampel (1974). “The influence curve and its role in robust estimation.” JASA, 69(346).
- P. Rousseeuw, M. Hubert (2011). “Robust statistics for outlier detection.” WIREs Data Mining and Knowledge Discovery, 1(1).
- B. Welford (1962). “Note on a method for calculating corrected sums of squares and products.” Technometrics, 4(3).
- T. Chan, G. Golub, R. LeVeque (1983). “Algorithms for computing the sample variance.” The American Statistician, 37(3).
- D. Freedman, P. Diaconis (1981). “On the histogram as a density estimator: L2 theory.” Z. Wahrscheinlichkeitstheorie, 57.
- B. Silverman (1986). Density Estimation for Statistics and Data Analysis. Chapman & Hall.
- R. Agarwal et al. (2021). “Deep reinforcement learning at the edge of the statistical precipice.” NeurIPS.
- K. Hundman et al. (2018). “Detecting spacecraft anomalies using LSTMs and nonparametric dynamic thresholding.” KDD.