Prediction markets: Large earthquakes

Recently, I saw Polymarket had a market on whether an earthquake with a magnitude greater than or equal to 8.0 will happen anywhere in the world before the 1st of June this year. I have previously seen similar markets on whether earthquakes of smaller magnitudes would happen in certain geographical locations, but since I know next to nothing about earthquakes, I just glossed over them. This one caught my eye, however, because even with my limited knowledge, I know a magnitude of 8.0 is a pretty big earthquake. At the time ‘No’ shares went for $0.8, which I thought seemed kind of low, so I calculated the probability to see if there was an opportunity to place a good bet.
Spoiler: There wasn’t.

Getting the data

To calculate the probability of an earthquake happening before the 1st of June, I went to the resolution source listed on the market to get some data. It lists every earthquake recorded back to 1900. Each row is one earthquake and has its magnitude, date, depth and its approximate location.

Unfortunately, there wasn’t an easy way to just download the data, so I copy-pasted each year back to 2000 into a spreadsheet. Sometimes when you copy tables from the web in this manner, it can automatically discern rows and columns, but that wasn’t the case here. Each row just ended in one cell without any spaces, but since the only value I needed was the magnitude, which happened to be the first 3 characters in every row, I just sliced each string1.

I loaded the data into a pandas dataframe and filtered for earthquakes with a magnitude of 8.0 or more. Using datetime I got the number of days from the 1st of January 2000 till today. Taking the total number of earthquakes with a magnitude of 8.0 or greater over the total number of days and multiplying this with the number of days remaining until the resolution date gives the expected value.

Calculating the probability

To calculate the probability I used the Poisson distribution. It is well suited for modelling the probability that a number of rare events will happen in a given time interval. It is defined as $$\text{Pr}(X=k) = \frac{\lambda^k e^{-\lambda}}{k!}$$ where $k$ is the number of events, $\lambda$ is the expected value of $X$ and $e$ is Euler’s number2.

As an example, say we want to find out the probability of 2 earthquakes happening during one month, then $k=2$ and if we know earthquakes on average happen 4 times a year, then $\lambda = \frac{4}{12} = 0.333$. Then we have $$\text{Pr}(X=2) = \frac{0.333^2 e^{-0.333}}{2!} \approx 0.0398$$

So in this scenario there is a probability of about 4% of 2 earthquakes happening in one month.

Using the poisson.pmf function from the Scipy library makes it easy to calculate the probability with our values by giving it the expected value calculated earlier and $k=0$, since we want the probability of no earthquakes occuring. Running this gives approximately 0.78, so that is a 78% probability that no earthquake will happen before the resolution date.

Conclusion

It turns out that I was wrong in my initial estimate of the market setting the probability too low. The market gave a 0.8 to ‘No’, so it was actually a bit overpriced compared to my calculation, especially when also counting fees. A few days later the market corrected to 0.78 for ‘No’ shares' and has since then been going up slowly, which it will probably keep doing as the resolution date gets nearer.

It appears that others have made the calculation as well.

Side note

I plotted the frequencies of the earthquakes by magnitude and was a bit surprised by the distribution. I expected it to be close to normal, but instead it looks like this

I have no idea why so many earthquakes have magnitudes between 6.0 and 7.0, but it seems kinda strange. A quick internet search didn’t give me an answer.


  1. It might be nice to have the location of the epicenter, but you have to follow the link for every earthquake, so it should probably be scraped automatically. ↩︎

  2. Not to be confused with Euler’s constant. ↩︎

Tree