Case Studies in Statistical Thinking
Justin Bois
Lecturer, Caltech
Date | Magnitude |
---|---|
684-11-24 | 8.4 |
887-08-22 | 8.6 |
1099-02-16 | 8.0 |
1361-07-26 | 8.4 |
1498-09-11 | 8.6 |
1605-02-03 | 7.9 |
1707-10-18 | 8.6 |
1854-12-23 | 8.4 |
1946-12-24 | 8.1 |
ECDF(x) = fraction of data points $\le$ x
# time_gap is an array of interearthquake times
_ = plt.plot(*dcst.ecdf(time_gap, formal=True))
_ = plt.xlabel('time between quakes (yr)')
_ = plt.ylabel('ECDF')
# Compute the mean time gap
mean_time_gap = np.mean(time_gap)
# Standard deviation of the time gap
std_time_gap = np.std(time_gap)
# Generate theoretical Exponential distribution of timings
time_gap_exp = np.random.exponential(mean_time_gap, size=100000)
# Generate theoretical Normal distribution of timings
time_gap_norm = np.random.normal(
mean_time_gap, std_time_gap, size=100000
)
# Plot theoretical CDFs
_ = plt.plot(*dcst.ecdf(time_gap_exp))
_ = plt.plot(*dcst.ecdf(time_gap_norm))
Case Studies in Statistical Thinking