Exercise

# 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`

.

Instructions

**100 XP**

- 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.