My first machine-learning script, November 2023, fit a line through 100 polite, made-up points with ordinary least squares. Least squares is a wonderful listener. It weighs every point equally, including the ones that are lying.

On a robot, points lie all the time. The pressure sensor that tells an underwater vehicle its depth gets calibrated by fitting exactly this kind of line, raw counts to metres. The calibration data arrives with bubbles on the port, cable tugs and the occasional bit-flip on the bus. So the real question: what fraction of the data can lie before the depth estimate is useless? Statisticians call that the breakdown point. I call it the moment the vehicle starts believing the pool is deeper than it is.
The interrogation
Each trial is a 120-reading calibration run. A growing fraction of the readings gets a spike of +2 to +6 m. Four estimators fit the line, scored on mean depth error across the sensor’s range, median over 40 trials.

| liars | least squares | Huber | Theil–Sen | RANSAC |
|---|---|---|---|---|
| 0 % | 0.3 cm | 0.3 cm | 0.5 cm | 0.3 cm |
| 5 % | 22.7 cm | 0.4 cm | 0.6 cm | 0.4 cm |
| 20 % | 84.7 cm | 1.2 cm | 0.7 cm | 0.3 cm |
| 35 % | 137.9 cm | 8.6 cm | 1.2 cm | 0.3 cm |
| 50 % | 199.5 cm | 185.7 cm | 8.2 cm | 0.4 cm |
| 60 % | 244.3 cm | 239.3 cm | 292.3 cm | 0.5 cm |
| under 5 cm until | 0 % | 30 % | 45 % | 60 %+ |
Verdicts
- Least squares breaks with one liar; its breakdown point is 0 %. Five percent bad readings put the vehicle 23 cm off in depth.
- Huber bends instead of breaking, and it’s cheap enough for a microcontroller. It collapses abruptly between 35 and 40 %.
- Theil–Sen takes the median of all pairwise slopes. Its theoretical breakdown is about 29 %, but it holds longer here because these liars scatter rather than agree.
- RANSAC wins this round, and the reason matters more than the win. It trusts the largest group that agrees. These liars disagree with each other, so they never outvote the truth.
No estimator survives an organised lie. That’s what a second, independent sensor is for.
A sensor that drifts consistently (a conspiracy, rather than a crowd of individual liars) would beat RANSAC too. That’s the limit of statistics: it can outvote noise, but it can’t outvote a systematic error. Physics, or a different instrument, has to do that.
From a study to a tool
The study became a tool. Give it a CSV of raw readings against ground truth and it fits a calibration that doesn’t take the liars’ side. RANSAC decides who to believe, then plain least squares refits the believers, because least squares is still the best judge of honest witnesses.
truth = 0.0124264 * raw + -1.71894 believed 46 of 60 readings refused row 13: raw=589 truth=9.347 refused row 17: raw=963 truth=15.739 … plain least squares would be off by up to 2.233 truth units across this range

- 0 %
- breakdown point of least squares: one liar is enough
- 60 %+
- lying readings RANSAC shrugged off, when the liars disagree
- 46 / 60
- readings the tool believed on its example file
Seeded, deterministic. python -m trustissues.run reproduces the table in about 50 s.
Try it with your own hands in the calibration bench: drag the slider and watch the dashed line get talked into things.
