The problem with the obvious method
The line you learned in school — least-squares regression — finds the slope that minimises the squared distance to every point. It works, but it's fragile: because it squares the errors, a single outlier (one weird year — a sensor glitch, an El Niño spike) can yank the whole line toward it. In climate records, weird years happen. So we want a slope that doesn't panic at outliers.
Theil–Sen: the median of every slope
The idea is almost laughably simple. Take every pair of points, draw the line between them, and write down its slope. With 24 years that's ~276 little slopes. The Theil–Sen estimate is just the median of all of them.
Because the median ignores extremes, a couple of bad years barely move it — you'd have to corrupt nearly half the data to break it. That robustness is why it's the standard for environmental trends.
Mann–Kendall: is the trend real?
A non-zero slope isn't enough — random noise also has a slope. Mann–Kendall asks a rank question: for every later year, is it usually higher (or lower) than the earlier years? It adds +1 for each later-and-higher pair, −1 for later-and-lower, and sums them into a score S. A big |S| relative to what noise would produce → a small p-value → "significant". It's non-parametric (no assumption the data is bell-curved), which suits messy climate series.
Play with it
Drag the sliders. Watch the robust Theil–Sen line (gold) barely flinch when you add an outlier, while least-squares (grey dashed) lurches. Turn the noise up until Mann–Kendall stops calling it significant.
Do it yourself — run it right here
You don't implement these by hand — two well-tested libraries do. This is exactly what runs server-side for a /verify trend. Hit Run, then change the noise and rerun until Mann–Kendall stops calling it significant:
The honest caveat
Mann–Kendall assumes each year is independent. Climate years are often autocorrelated (a wet year nudges the next), which makes the basic p-value optimistic — it can call things significant a touch too readily. The grown-up fix is a variance correction (e.g. Hamed–Rao). The /verify cards note this; it's the difference between "computed" and a number you'd stake a paper on.