rBeta

rBeta(*args)

Realization of a Beta distribution on [0,1].

Parameters:
alphafloat, \alpha > 0

Parameter \alpha.

betafloat, \beta > 0

Parameter \beta.

sizeint

The number of realizations to generate.

Returns:
realizationsfloat or sequence of float

The realizations of the distribution.

Notes

The probability density function is defined as:

p(x) = \dfrac{1}{B(\alpha, \beta)}x^{(\alpha-1)}(1-x)^{(\beta-1)} \quad x \in [0,1]

with \alpha, \beta > 0 and where \rm B denotes Euler’s beta function Beta().

This method is based on Cheng’s algorithm (1978) and Johnk, Atkinson and Whittaker’s algorithm (1979) described in [devroye1986] with the important errata [devroye1986b].

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> r = ot.DistFunc.rBeta(2.5, 3.5)