Distribution fitting test using QQ plotΒΆ

In this example we are going to perform a visual goodness-of-fit test for an 1-d distribution with the QQ plot.

In [25]:
from __future__ import print_function
import openturns as ot
In [26]:
# Create data
ot.RandomGenerator.SetSeed(0)
distribution = ot.Gumbel(5.0, 0.5)
sample = distribution.getSample(50)
sample.setDescription(['Sample'])
In [27]:
# Fit a distribution
distribution = ot.GumbelFactory().build(sample)
In [28]:
# Draw QQ plot
ot.VisualTest.DrawQQplot(sample, distribution)
Out[28]:
../../_images/examples_data_analysis_qqplot_graph_5_0.svg