我正在 Python Spark-ml 中进行正态性测试,看到了我的结果think是一个错误。
这是设置,我有一个标准化的数据集(范围 -1 到 1)。
当我做直方图时,我可以清楚地看到数据不正常:
>>> prices_norm.histogram(10)
([-1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0],
[226, 269, 119, 95, 52, 26, 8, 2, 2, 5])
当我运行 Kolmogorov-Smirnov 测试时,我得到以下结果:
>>> testResults = Statistics.kolmogorovSmirnovTest(prices_norm, "norm")
>>> print testResults
Kolmogorov-Smirnov test summary:
degrees of freedom = 0
statistic = 0.46231145770077375
pValue = 1.742039845709087E-11
Very strong presumption against null hypothesis: Sample follows theoretical distribution.
柯尔莫哥洛夫-斯米尔诺夫检验定义了零假设 (H0) as: 数据遵循指定的分布 (http://www.itl.nist.gov/div898/handbook/eda/section3/eda35g.htm http://www.itl.nist.gov/div898/handbook/eda/section3/eda35g.htm).
在这种情况下,p 值非常低,因此我们应该拒绝原假设。这是有道理的,因为这显然不正常。
那么为什么它说:
Sample follows theoretical distribution
这不是错了吗?难道不应该说样本不遵循理论分布吗?我错过了什么吗?