01 / case study / Oct 2026
Earthquake aftershock forecasts
Every earthquake this month on a live globe, and the chance of a strong aftershock after each big one. Tested on 780 earthquakes it never saw.
Python · pandas · SciPy · Next.js · Three.js
The short version
After a magnitude 6 or bigger earthquake, people want to know one thing: is another strong one coming? I built a model that gives the chance of at least one magnitude 5+ aftershock in the week after the first day.
It runs live on this site. Every earthquake of the last 30 days is on a globe, straight from the US Geological Survey, and every big one shows the model's forecast next to what actually happened.
Where the data comes from
The USGS catalogue: every magnitude 4.5+ earthquake worldwide from 2000 to October 2026, 187,392 of them. The live page reads USGS's public feed of the last 30 days, which updates every couple of minutes.
How it works
- Find the sequences. Each magnitude 6+ earthquake that isn't itself an aftershock of a bigger one is a mainshock. Its aftershocks are the magnitude 5+ earthquakes within a distance that grows with its size.
- Fit the pattern. Aftershocks thin out over time in a well-known way (Reasenberg and Jones, 1989), and bigger earthquakes have more of them. I fitted that pattern's four numbers to 2,564 mainshocks from 2000 to 2019.
- Let the first day speak. Some sequences are far busier than others. So the forecast is made at the end of day one, and that day's count adjusts it. The count is trusted about a third of the way, a weight also chosen on the training years only.
- Freeze it, then test it. Nothing was tuned on 2020 to 2026. The model was asked about every one of those 780 mainshocks as if it were happening live.
What it found
- 27% more accurate than the historical rate. Forecast error (the Brier score, lower is better) was 0.127 for the model, against 0.175 for just saying "the usual rate" every time.
- The first day matters most. The same model without the first-day update scored 0.160. Most of the gain comes from watching how a sequence starts.
- Its percentages mean what they say. When it said about 14%, a strong aftershock came 13% of the time. When it said about 40%, it was 39%.
- It's a little too sure at the top. When it said 98%, it happened 91% of the time. Only 59 of the 780 forecasts were above 70%, so that's the part with the least to learn from.
What it doesn't do
It doesn't predict earthquakes. It only says what tends to follow one that has already happened. It uses one set of numbers for the whole planet, though a subduction zone and a mid-ocean ridge don't behave alike. Fitting the numbers region by region, and updating the forecast hour by hour through the week, are the next steps.