且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

python中Weibull分布的拟合优度检验

更新时间:2021-07-10 01:27:59

Liliefors测试在 OpenTURNS href ="http://www.openturns.org/"中实现>.为此,您只需要使用与要分配的分布相对应的Factory. 在以下脚本中,我模拟了大小为10的Weibull样本,并使用等于1000的样本大小执行了Kolmogorov-Smirnov测试.这意味着KS统计量被模拟了1000次.

The Lilliefors test is implemented in OpenTURNS. To do this, all you have to use the Factory which corresponds to the distribution you want to fit. In the following script, I simulate a Weibull sample with size 10 and perform the Kolmogorov-Smirnov test using a sample size equal to 1000. This means that the KS statistics is simulated 1000 times.

import openturns as ot
sample=ot.WeibullMin().getSample(10)
ot.ResourceMap.SetAsUnsignedInteger("FittingTest-KolmogorovSamplingSize",1000)
distributionFactory = ot.WeibullMinFactory()
dist, result = ot.FittingTest.Kolmogorov(sample, distributionFactory, 0.01)
print('Conclusion=', result.getBinaryQualityMeasure())
print('P-value=', result.getPValue())

更多详细信息,请访问:

More details can be found at:

  • http://openturns.github.io/openturns/latest/examples/data_analysis/kolmogorov_test.html
  • http://openturns.github.io/openturns/latest/examples/data_analysis/kolmogorov_distribution.html