HypothesisTest_FullSpearman¶
-
HypothesisTest_FullSpearman
(firstSample, secondSample, level=0.05)¶ Test whether two samples have no rank correlation.
Available usages:
HypothesisTest.FullSpearman(firstSample, secondSample)
HypothesisTest.FullSpearman(firstSample, secondSample, level)
- Parameters
- firstSample2-d sequence of float
Sample of dimension .
- secondSample2-d sequence of float
Sample of dimension 1.
- levelpositive float
Threshold p-value of the test (= first kind risk), it must be , equal to 0.05 by default.
- Returns
- testResult
TestResultCollection
Collection of
TestResult
of size , one result per component of the first sample.
- testResult
Notes
The Full Spearman Test is used to check the hypothesis of no rank correlation between two samples: firstSample of dimension and secondSample of dimension 1. The test is done marginal by marginal on the first sample.
Examples
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> distribution = ot.Normal() >>> sample = distribution.getSample(30) >>> func = ot.SymbolicFunction(['x'], ['x', 'x^2']) >>> testedSample = func(sample) >>> test_result = ot.HypothesisTest.FullSpearman(testedSample, sample, 0.05) >>> print(test_result) [class=TestResult name=Unnamed type=Spearman binaryQualityMeasure=false p-value threshold=0.05 p-value=0 statistic=1.79769e+308 description=[],class=TestResult name=Unnamed type=Spearman binaryQualityMeasure=true p-value threshold=0.05 p-value=0.442067 statistic=-0.774521 description=[]]