# HypothesisTest_Smirnov¶

HypothesisTest_Smirnov(firstSample, secondSample, level=0.05)

Test whether two samples follows the same distribution.

Refer to Smirnov samples comparison test.

Available usages:

HypothesisTest.Smirnov(firstSample, secondSample)

HypothesisTest.Smirnov(firstSample, secondSample, level)

Parameters: firstSample : 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 (= first kind risk), it must be , equal to 0.05 by default. testResult : TestResult Structure containing the result of the test.

Notes

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 analysis.

Examples

>>> 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=[]