Test distribution fitting using KolmogorovΒΆ

In this example we are going to perform a Kolmogorov goodness-of-fit test for an 1-d continuous distribution.

In [20]:
from __future__ import print_function
import openturns as ot
In [21]:
# Create data
distribution = ot.Normal()
sample = distribution.getSample(50)
In [22]:
# Estimate the Spearman correlation
result = ot.FittingTest.Kolmogorov(sample, ot.NormalFactory(), 0.99)
print('Conclusion=', result.getBinaryQualityMeasure(), 'P-value=', result.getPValue())
Conclusion= True P-value= 0.5902455836497116