HypothesisTest_PartialSpearman¶
- HypothesisTest_PartialSpearman(firstSample, secondSample, selection, level=0.05)¶
Test whether two sample have no rank correlation.
Available usages:
HypothesisTest_PartialSpearman(firstSample, secondSample, selection)
HypothesisTest_PartialSpearman(firstSample, secondSample, selection, level)
- Parameters
- firstSample2-d sequence of float
First tested sample, of dimension .
- secondSample2-d sequence of float
Second tested sample, of dimension 1.
- selectionsequence of integers, maximum integer value
List of indices selecting which subsets of the first sample will successively be tested with the second sample through the Spearman test.
- levelpositive float
Threshold p-value of the test (= first kind risk), it must be , equal to 0.05 by default.
- Returns
- testResult
TestResult
Structure containing the result of the test.
- testResult
Notes
The Partial Spearman Test is used to check hypothesis of no rank correlation between two samples: firstSample of dimension and secondSample of dimension 1. The parameter selection enables to select specific subsets of marginals of firstSample to be tested.
Examples
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> distribution = ot.Normal() >>> sample = distribution.getSample(30) >>> func = ot.SymbolicFunction(['x'], ['x', 'x^2', 'x^3', 'sin(5*x)']) >>> testedSample = func(sample) >>> test_result = ot.HypothesisTest.PartialSpearman(testedSample, sample, [0,3]) >>> 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.570533 statistic=-0.569502 description=[]]