Estimates of the mean interearthquake times
The graphical EDA in the last exercise shows an obvious change in earthquake frequency around 2010. To compare, compute the mean time between earthquakes of magnitude 3 and larger from 1980 through 2009 and also from 2010 through mid-2017. Also include 95% confidence intervals of the mean. The variables dt_pre
and dt_post
respectively contain the time gap between all earthquakes of magnitude at least 3 from pre-2010 and post-2010 in units of days.
Cet exercice fait partie du cours
Case Studies in Statistical Thinking
Instructions
- Compute the mean interearthquake time for pre- (
dt_pre
) and post-2010 (dt_post
). - Draw 10,000 bootstrap replicates of the mean for the pre- and post-2010 datasets.
- Use
np.percentile()
to compute the 95% confidence interval of the mean for both datasets. - Hit 'Submit Answer' to print the results to the screen.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Compute mean interearthquake time
mean_dt_pre = ____
mean_dt_post = ____
# Draw 10,000 bootstrap replicates of the mean
bs_reps_pre = ____
bs_reps_post = ____
# Compute the confidence interval
conf_int_pre = ____
conf_int_post = ____
# Print the results
print("""1980 through 2009
mean time gap: {0:.2f} days
95% conf int: [{1:.2f}, {2:.2f}] days""".format(mean_dt_pre, *conf_int_pre))
print("""
2010 through mid-2017
mean time gap: {0:.2f} days
95% conf int: [{1:.2f}, {2:.2f}] days""".format(mean_dt_post, *conf_int_post))