Test normality using Anderson-DarlingΒΆ
In this example we are going to evaluate whether a sample follows a normal distribution.
[1]:
from __future__ import print_function
import openturns as ot
[2]:
# Generate a sample
sample = ot.Normal().getSample(200)
[3]:
# Test normality
test_result = ot.NormalityTest.AndersonDarlingNormal(sample)
print('Component is normal?', test_result.getBinaryQualityMeasure(),
'p-value=%.6g' % test_result.getPValue(),
'threshold=%.6g' % test_result.getThreshold())
Component is normal? True p-value=0.829806 threshold=0.05
[5]:
# Test succeeded ?
test_result.getBinaryQualityMeasure()
[5]:
True
[7]:
# P-Value
test_result.getPValue()
[7]:
0.8298062868104503