python实现D'Agostino's K-squared test正态分布检验
测试数据样本是否具有高斯分布。
假设条件
- 每个样本中的观察结果都是独立且均等分布的(iid)。
解释
- H0:样本具有高斯分布。
- H1:样本没有高斯分布。
Python代码
# Example of the D'Agostino's K^2 Normality Test
from scipy.stats import normaltest
data = [0.873, 2.817, 0.121, -0.945, -0.055, -1.436, 0.360, -1.478, -1.637, -1.869]
stat, p = normaltest(data)
print('stat=%.3f, p=%.3f' % (stat, p))
if p > 0