1%feature("docstring") OT::Geometric 2"Geometric distribution. 3 4Available constructors: 5 Geometric(*p=0.5*) 6 7Parameters 8---------- 9p : float, :math:`0 < p \leq 1` 10 Success probability of the Bernoulli trial. 11 12Notes 13----- 14Its probability density function is defined as: 15 16.. math:: 17 18 \Prob{X = k} = p (1 - p)^{k - 1}, 19 \quad \forall k \in \Nset^* 20 21with :math:`0 < p \leq 1`. 22 23Its first moments are: 24 25.. math:: 26 :nowrap: 27 28 \begin{eqnarray*} 29 \Expect{X} & = & \frac{1}{p} \\ 30 \Var{X} & = & \frac{1 - p}{p^2} 31 \end{eqnarray*} 32 33See Also 34-------- 35Bernoulli 36 37Examples 38-------- 39Create a distribution: 40 41>>> import openturns as ot 42>>> distribution = ot.Geometric(0.5) 43 44Draw a sample: 45 46>>> sample = distribution.getSample(5)" 47 48// --------------------------------------------------------------------- 49 50%feature("docstring") OT::Geometric::getP 51"Accessor to the success probability parameter. 52 53Returns 54------- 55p : float 56 The success probability of the Bernoulli trial." 57 58// --------------------------------------------------------------------- 59 60%feature("docstring") OT::Geometric::setP 61"Accessor to the success probability parameter. 62 63Parameters 64---------- 65p : float, :math:`0 < p \leq 1` 66 The success probability of the Bernoulli trial." 67