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.

[17]:
from __future__ import print_function
import openturns as ot
[18]:
# Create data
ot.RandomGenerator.SetSeed(0)
distribution = ot.Gumbel(0.2, 0.5)
sample = distribution.getSample(100)
sample.setDescription(['Sample'])
[19]:
# Fit a distribution
distribution = ot.GumbelFactory().build(sample)
[20]:
# Draw QQ plot
ot.VisualTest.DrawQQplot(sample, distribution)
[20]:
../../_images/examples_data_analysis_qqplot_graph_5_0.svg
[21]:
# Incorrect proposition
ot.VisualTest.DrawQQplot(sample, ot.WeibullMin())
[21]:
../../_images/examples_data_analysis_qqplot_graph_6_0.svg