Create a geometric distributionΒΆ

In this basic example we are going to create a geometric distribution with parameter

p = 0.7

In [5]:
from __future__ import print_function
import openturns as ot

distribution = ot.Geometric(0.7)
print(distribution)
Geometric(p = 0.7)
In [6]:
sample = distribution.getSample(10)
print(sample)
    [ X0 ]
0 : [ 1  ]
1 : [ 1  ]
2 : [ 1  ]
3 : [ 1  ]
4 : [ 1  ]
5 : [ 2  ]
6 : [ 1  ]
7 : [ 1  ]
8 : [ 1  ]
9 : [ 1  ]
In [7]:
distribution.drawCDF()
Out[7]:
../../_images/examples_probabilistic_modeling_geometric_distribution_4_0.svg