VisualTest_DrawEmpiricalCDF

(Source code, png, hires.png, pdf)

../../_images/VisualTest_DrawEmpiricalCDF.png
VisualTest_DrawEmpiricalCDF(sample, xMin, xMax)

Draw an empirical CDF.

Available usages:
VisualTest.DrawEmpiricalCDF(sample, Xmin, Xmax)
Parameters:

sample : 2-d sequence of float

Sample to draw.

Xmin, Xmax : float with Xmin < Xmax

Lower and upper boundaries of the graph.

Returns:

graph : class:~openturns.Graph

The graph object

Notes

The created graph contains a staircase curve which is the empirical CDF of the sample.

Examples

>>> import openturns as ot
>>> from openturns.viewer import View

Generate a random sample from a Normal distribution:

>>> ot.RandomGenerator.SetSeed(0)
>>> sample = ot.Normal(1).getSample(100)
>>> Xmin = sample.getMin()[0]
>>> Xmax = sample.getMax()[0]

Draw an empirical CDF:

>>> empiricalCDF = ot.VisualTest.DrawEmpiricalCDF(sample, Xmin - 1.0, Xmax + 1.0)
>>> View(empiricalCDF).show()