TestResult

class TestResult(*args)

Test result data structure.

Warning

Tests results are not intended to be created manually. They are returned by the various statistical tests available. Constructor is therefore intentionally not documented.

Notes

The p-value of a test can be seen as the probability of observing a sample having a worst or equal statistic than the one that has been calculated on the tested sample, under the null hypothesis. This is the metric that is used for concluding the test with respect to the given accepted risk of committing a Type I error, that is an incorrect rejection of a true null hypothesis.

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> distribution = ot.Normal()
>>> sample = distribution.getSample(30)
>>> dist, test_result = ot.FittingTest.Lilliefors(sample, ot.NormalFactory(), 0.01)
>>> print(test_result.getPValue())
0.4956...
>>> print(test_result.getThreshold())
0.01...
>>> print(test_result.getBinaryQualityMeasure())
True

Methods

getBinaryQualityMeasure()

Accessor to the test's binary conclusion.

getClassName()

Accessor to the object's name.

getDescription()

Accessor to the test description.

getName()

Accessor to the object's name.

getPValue()

Accessor to the test's p-value.

getStatistic()

Accessor to the used statistic for decision.

getTestType()

Accessor to the test type.

getThreshold()

Accessor to the accepted risk of committing a Type I error.

hasName()

Test if the object is named.

setDescription(description)

Accessor to the test description.

setName(name)

Accessor to the object's name.

__init__(*args)
getBinaryQualityMeasure()

Accessor to the test’s binary conclusion.

Returns:
binary_measurebool, optional

Test conclusion: False if it can reject the null hypothesis, True if it cannot.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getDescription()

Accessor to the test description.

Returns:
statisticDescription

Test description.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getPValue()

Accessor to the test’s p-value.

Returns:
p_valuefloat, 0 \leq p \leq 1

The test’s p-value.

getStatistic()

Accessor to the used statistic for decision.

Returns:
statisticfloat

Measure used for the statistical test.

getTestType()

Accessor to the test type.

Returns:
typestr

Test type.

getThreshold()

Accessor to the accepted risk of committing a Type I error.

Returns:
thresholdfloat, 0 \leq \alpha \leq 1

Accepted risk of committing a Type I error.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

setDescription(description)

Accessor to the test description.

Parameters:
descriptionsequence of str

Test description.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

Examples using the class

Build and validate a linear model

Build and validate a linear model

Estimate a GEV on the Port Pirie sea-levels data

Estimate a GEV on the Port Pirie sea-levels data

Estimate a GPD on the daily rainfall data

Estimate a GPD on the daily rainfall data

Estimate a GEV on race times data

Estimate a GEV on race times data

Estimate a GEV on the Fremantle sea-levels data

Estimate a GEV on the Fremantle sea-levels data

Test a discrete distribution

Test a discrete distribution

Use the Kolmogorov/Lilliefors test

Use the Kolmogorov/Lilliefors test

Test identical distributions

Test identical distributions

Select fitted distributions

Select fitted distributions

Test Normality

Test Normality

Test independence

Test independence

Kolmogorov-Smirnov : understand the p-value

Kolmogorov-Smirnov : understand the p-value