Parkfield 的 b 值
ECDF 能有效揭示低端"回落"(roll-off),正如下方 1 级以下所见。由于 3 级以上的地震事件足够多,您可以使用 mt = 3 作为完整性阈值。基于该完整性阈值,计算 1950 至 2016 年 Parkfield 区域的 b 值以及 95% 置信区间,并将结果打印到屏幕。变量 mags(包含所有震级)已在您的命名空间中。
叠加理论 Exponential CDF,以验证 Parkfield 区域是否遵循 Gutenberg–Richter 定律。
本练习是课程的一部分
统计思维案例研习
练习说明
- 使用您的
b_value()函数计算 b 值和 95% 置信区间。使用 10,000 次自助法重复。 - 使用
np.random.exponential()从理论分布中抽取 100,000 个样本。该分布的均值为b/np.log(10),并且需要给样本加上mt以正确处理位置参数。将结果存入m_theor。 - 将
m_theor的 ECDF 以折线绘制。 - 将所有大于
mt的震级的 ECDF 以散点绘制。 - 点击 "Submit Answer" 显示图形,并在屏幕上打印 b 值和置信区间。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Compute b-value and 95% confidence interval
b, conf_int = ____(____, ____, ____=[____, ____], n_reps=____)
# Generate samples to for theoretical ECDF
m_theor = ____(____, size=____) + ____
# Plot the theoretical CDF
_ = ____(*____)
# Plot the ECDF (slicing mags >= mt)
_ = plt.plot(*____(____[____ >= ____]), marker='.', linestyle='none')
# Pretty up and show the plot
_ = plt.xlabel('magnitude')
_ = plt.ylabel('ECDF')
_ = plt.xlim(2.8, 6.2)
plt.show()
# Report the results
print("""
b-value: {0:.2f}
95% conf int: [{1:.2f}, {2:.2f}]""".format(b, *conf_int))