HypothesisTest_Smirnov(firstSample, secondSample, level=0.95)¶
Test whether two samples follows the same distribution.
HypothesisTest.Smirnov(firstSample, secondSample, level)
fisrtSample : 2-d sequence of float
First tested sample, of dimension .
secondSample : 2-d sequence of float
Second tested sample, of dimension 1.
level : positive float
Threshold p-value of the test (= 1 - first type risk), it must be , equal to 0.95 by default.
Structure containing the result of the test.
Smirnov’s test is a tool that may be used to compare two samples and (of sizes not necessarily equal). The goal is to determine whether these two samples come from the same probability distribution or not. If this is the case, the two samples should be aggregated in order to increase the robustness of further statistical analyses.
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> distCol = [ot.Normal(), ot.Normal()] >>> firstSample = ot.Normal().getSample(30) >>> secondSample = ot.Normal().getSample(30) >>> test_result = ot.HypothesisTest.Smirnov(firstSample, secondSample) >>> print(test_result) class=TestResult name=Unnamed type=TwoSampleSmirnov binaryQualityMeasure=true p-value threshold=0.05 p-value=0.807963 description=