開始使用免費開始

b 值的量化

根據你在前一個練習產生的圖形,你可以放心使用 mt = 3 作為完備性門檻。請用這個門檻,分別計算 1980–2009 年,以及 2010 年到 2017 年中期的 b 值。你在上一章寫的函式 b_value()(可由一組震級與完備性門檻計算 b 值與信賴區間)已可在你的命名空間中使用;同樣可用的還有上一個練習的 numpy 陣列 mags_premags_post,以及 mt

本練習屬於課程

統計思維個案研究

檢視課程

練習說明

  • 使用 10,000 次自助抽樣,計算 1980–2009 年地震的 b 值與 95% 信賴區間。
  • 使用 10,000 次自助抽樣,計算 2010 年到 2017 年中期地震的 b 值與 95% 信賴區間。
  • 按下「Submit Answer」把結果印在螢幕上。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Compute b-value and confidence interval for pre-2010
b_pre, conf_int_pre = ____(____, ____, ____=[____, ____], ____=____)

# Compute b-value and confidence interval for post-2010
b_post, conf_int_post = ____

# Report the results
print("""
1980 through 2009
b-value: {0:.2f}
95% conf int: [{1:.2f}, {2:.2f}]

2010 through mid-2017
b-value: {3:.2f}
95% conf int: [{4:.2f}, {5:.2f}]
""".format(b_pre, *conf_int_pre, b_post, *conf_int_post))
編輯並執行程式碼