FittingTest_TwoSamplesKolmogorov(sample1, sample2, level=0.95)

Perform a Kolmogorov goodness-of-fit test on two samples.

If the p-value is high, then we cannot reject the hypothesis that the distributions of the two samples are the same.


sample1 : 2-d float array

A continuous distribution sample.

sample2 : 2-d float array

Another continuous distribution sample, can be of different size.

level : float, 0 \leq {\rm level} \leq 1, optional

This the value such that \alpha = 1 - {\rm level} is the risk of committing a Type I error, that is an incorrect rejection of a true null hypothesis.


test_result : TestResult

Test result.


>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> sample1 = ot.Normal().getSample(20)
>>> sample2 = ot.Normal(0.1, 1.1).getSample(30)
>>> ot.FittingTest.TwoSamplesKolmogorov(sample1, sample2)
class=TestResult name=Unnamed type=Kolmogorov Normal/Normal binaryQualityMeasure=true p-value threshold=0.05 p-value=0.554765 description=[sampleNormal vs sample Normal]