When will the next big Parkfield quake be?

The last big earthquake in the Parkfield region was on the evening of September 27, 2004 local time. Your task is to get an estimate as to when the next Parkfield quake will be, assuming the Exponential model and also the Gaussian model. In both cases, the best estimate is given by the mean time gap, which you computed in the last exercise to be 24.62 years, meaning that the next earthquake would be in 2029. Compute 95% confidence intervals on when the next earthquake will be assuming an Exponential distribution parametrized by mean_time_gap you computed in the last exercise. Do the same assuming a Normal distribution parametrized by mean_time_gap and std_time_gap.

This exercise is part of the course

Case Studies in Statistical Thinking

View Course

Exercise instructions

  • Draw 100,000 sample from an Exponential distribution with a mean given by mean_time_gap. Store the result in exp_samples.
  • Draw 100,000 sample from a Normal distribution with a mean given by mean_time_gap and standard deviation given by std_time_gap. Store the result in norm_samples.
  • Because there has not been a Parkfield earthquake as of today, slice out samples that are greater than today - last_quake, where I have stored the decimal year of today as today, and last_quake = 2004.74, the decimal year of the last Parkfield earthquake. Overwrite the respective exp_samples and norm_samples variables with these sliced arrays.
  • Use np.percentile() to compute the 95% confidence interval for when the next Parkfield earthquake will be. In the same function call, you can also compute the median by including the 50th percentile.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Draw samples from the Exponential distribution: exp_samples
exp_samples = ____

# Draw samples from the Normal distribution: norm_samples
norm_samples = ____

# No earthquake as of today, so only keep samples that are long enough
exp_samples = ____[____ > ____ - ____]
norm_samples = ____[____ > ____ - ____]

# Compute the confidence intervals with medians
conf_int_exp = ____(____, [____, ____, ____]) + last_quake
conf_int_norm = ____(____, [____, ____, ____]) + last_quake

# Print the results
print('Exponential:', conf_int_exp)
print('     Normal:', conf_int_norm)