【发布时间】:2018-01-21 20:19:15
【问题描述】:
我正在阅读一本关于 Python 数据科学的书,作者应用“sigma-clipping operation”来删除由于拼写错误而导致的异常值。但是根本没有解释这个过程。
什么是 sigma 裁剪?它是否仅适用于某些数据(例如,在书中用于计算美国的出生率)?
根据正文:
quartiles = np.percentile(births['births'], [25, 50, 75]) #so we find the 25th, 50th, and 75th percentiles
mu = quartiles[1] #we set mu = 50th percentile
sig = 0.74 * (quartiles[2] - quartiles[0]) #???
This final line is a robust estimate of the sample mean, where the 0.74 comes
from the interquartile range of a Gaussian distribution.
为什么是 0.74?有证据吗?
【问题讨论】:
-
您的回复无济于事。你读过上面的问题了吗?
-
你混合了截然不同的问题。 什么是 sigma 裁剪? 在上面的链接中得到了完美的回答。 为什么是 0.74? 和引用的书本与 sigma 裁剪无关,在下面回答。
-
为什么是 0.74? normal/Gaussian distribution 的一个基本属性是 50% 的值与平均值的最大距离为 0.67 σ(IQR,参见 this image 和 this article)。 0.74 = 1 / (2x0.67)。 “稳健”意味着不受异常极值的影响(异常值在 IQR 之外,因此不用于估计 σ)。
标签: python pandas numpy statistics data-science