Perform a Kolmogorov goodness-of-fit test for 1-d continuous distributions.
sample : 2-d sequence of float
level : float, , optional
This is the value such that is the risk of committing a Type I error, that is an incorrect rejection of a true null hypothesis.
n_parameters : int, , optional
The number of parameters in the distribution that have been estimated from the sample. This parameter must not be provided if a
DistributionFactorywas provided as the second argument (it will internally be set to the number of parameters estimated by the
DistributionFactory). It can be specified if a
Distributionwas provided as the second argument, but if it is not, it will be set equal to 0.
TypeError : If the distribution is not continuous or if the sample is
The present implementation of the Kolmogorov goodness-of-fit test is two-sided. This uses an external C implementation of the Kolmogorov cumulative distribution function by [Simard2011].
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> distribution = ot.Normal() >>> sample = distribution.getSample(30) >>> ot.FittingTest.Kolmogorov(sample, ot.NormalFactory(), .99) class=TestResult name=Unnamed type=KolmogorovDistribution binaryQualityMeasure=true p-value threshold=0.01 p-value=0.846896 description=[Normal(mu = -0.0944924, sigma = 0.989808) vs sample Normal]