LinearModelTest_LinearModelFisher¶
- LinearModelTest_LinearModelFisher(*args)¶
Test the nullity of the linear regression model coefficients.
Available usages:
LinearModelTest.LinearModelFisher(firstSample, secondSample)
LinearModelTest.LinearModelFisher(firstSample, secondSample, level)
LinearModelTest.LinearModelFisher(firstSample, secondSample, linearModelResult)
LinearModelTest.LinearModelFisher(firstSample, secondSample, linearModelResult, level)
- Parameters
- firstSample2-d sequence of float
First tested sample, of dimension 1.
- secondSample2-d sequence of float
Second tested sample, of dimension 1.
- linearModelResult
LinearModelResult
A linear model. If not provided, it is built using the given samples.
- 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 LinearModelTest class is used through its static methods in order to evaluate the quality of the linear regression model between two samples. The linear regression model between the scalar variable and the -dimensional one is as follows:
where is the residual, supposed to follow the standard Normal distribution.
The LinearModelFisher test checks the nullity of the regression linear model coefficients (Fisher distribution is used).
Examples
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> distribution = ot.Normal() >>> sample = distribution.getSample(30) >>> func = ot.SymbolicFunction('x', '2 * x + 1') >>> firstSample = sample >>> secondSample = func(sample) + ot.Normal().getSample(30) >>> test_result = ot.LinearModelTest.LinearModelFisher(firstSample, secondSample) >>> print(test_result.getPValue()) 5.1...e-12