Normal fitting test using the Henry lineΒΆ

In this example we are going to perform a visual goodness-of-fit test for an univariate normal distribution using the Henry line test, which is the QQ plot adapted for Gaussian distirbutions.

In [23]:
from __future__ import print_function
import openturns as ot
In [24]:
# Create data
ot.RandomGenerator.SetSeed(0)
distribution = ot.Normal(2.0, 0.5)
sample1 = distribution.getSample(100)
In [25]:
# Draw Henry line plot (good)
ot.VisualTest_DrawHenryLine(sample1)
Out[25]:
../../_images/examples_data_analysis_henry_line_graph_4_0.svg
In [26]:
# Draw Henry line plot for a Beta (bad)
sample2 = ot.Beta(0.7, 1.6, 0.0, 2.0).getSample(100)
ot.VisualTest_DrawHenryLine(sample2)
Out[26]:
../../_images/examples_data_analysis_henry_line_graph_5_0.svg