HypothesisTest_FullRegression

HypothesisTest_FullRegression(firstSample, secondSample, level=0.95)

Test whether two discrete samples are not linear.

Available usages:

HypothesisTest.FullRegression(firstSample, secondSample)

HypothesisTest.FullRegression(firstSample, secondSample, level)

Parameters:

fisrtSample : 2-d sequence of float

First tested sample, of dimension n \geq 1.

secondSample : 2-d sequence of float

Second tested sample, of dimension 1.

level : positive float < 1

Threshold p-value of the test (= 1 - first type risk), it must be < 1, equal to 0.95 by default.

Returns:

testResult : TestResult

Structure containing the result of the test.

Notes

The Full Regression Test is used to check the quality of the linear regression model between two samples: firstSample of dimension n and secondSample of dimension 1. If firstSample[i] is the numerical sample extracted from firstSample (i^{th} coordinate of each point of the numerical sample), FullRegression performs the linear regression test simultaneously on all firstSample[i] and secondSample. The linear regression test tests if the linear regression model between two scalar numerical samples is not significant. It is based on the deviation analysis of the regression. The Fisher distribution is used.

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> dim = 3
>>> distCol = [ot.Normal()] * dim
>>> S = ot.CorrelationMatrix(dim)
>>> S[0, dim - 1] = 0.99
>>> copula = ot.NormalCopula(S)
>>> distribution = ot.ComposedDistribution(distCol, copula)
>>> sample = distribution.getSample(30)
>>> firstSample = sample[:, :2]
>>> secondSample = sample[:, 2]
>>> test_result = ot.HypothesisTest.FullRegression(firstSample, secondSample)
>>> print(test_result)
[class=TestResult name=Unnamed type=Regression binaryQualityMeasure=false p-value threshold=0.05 p-value=9.70282e-27 description=[],class=TestResult name=Unnamed type=Regression binaryQualityMeasure=true p-value threshold=0.05 p-value=0.11352 description=[]]