กรณีศึกษาด้านการคิดเชิงสถิติ
Justin Bois
Lecturer, Caltech
"การวิเคราะห์ข้อมูลเชิงสำรวจไม่อาจเป็นทั้งหมดของเรื่อง แต่ไม่มีสิ่งใดทำหน้าที่เป็นรากฐานได้ดีไปกว่านี้"
--John Tukey

np.mean(nuclear_incident_times)
87.140350877192986

อาร์เรย์ที่สุ่มตัวอย่างใหม่จากข้อมูล
# Resample nuclear_incident_times with replacement
bs_sample = np.random.choice(
nuclear_incident_times,
replace=True,
size=len(inter_times)
)




Bootstrap replicate: สถิติที่คำนวณจาก bootstrap sample
ฟังก์ชันสำหรับสุ่ม bootstrap replicates จากชุดข้อมูล
# Draw 10000 replicates of the mean from
# nuclear_incident_times
bs_reps = dcst.draw_bs_reps(
nuclear_incident_times, np.mean, size=10000
)

หากวัดซ้ำหลาย ๆ ครั้ง ค่าที่สังเกตได้ p% จะอยู่ภายใน confidence interval ระดับ p%
np.percentile(bs_reps, [2.5, 97.5])
array([ 73.31505848, 102.39181287])
กรณีศึกษาด้านการคิดเชิงสถิติ