美文网首页
Python检验Kolmogorov–Smirnov test(

Python检验Kolmogorov–Smirnov test(

作者: 王叽叽的小心情 | 来源:发表于2020-03-22 16:27 被阅读0次

Kolmogorov–Smirnov test(KS):判断两个样本的分布是否有差异/是否与正态分布相同

1. 检验指定的数列是否服从正态分布

from scipy.stats import kstest
import numpy as np
 
x = np.random.normal(0,1,1000)
test_stat = kstest(x, 'norm')

2. 检验指定的两个数列是否服从相同分布

from scipy.stats import ks_2samp
beta=np.random.beta(7,5,1000)
norm=np.random.normal(0,1,1000)
ks_2samp(beta,norm)

参考资料:https://www.cnblogs.com/webRobot/p/9114411.html

相关文章

网友评论

      本文标题:Python检验Kolmogorov–Smirnov test(

      本文链接:https://www.haomeiwen.com/subject/vgdvyhtx.html