rUniformSimplex

rUniformSimplex(*args)

Realization of a uniform distribution over a simplex.

Parameters:
vertices2-d sequence of float, a list of points in \Rset^n

The vertices of the simplex.

sizeint

The number of realizations to generate.

Returns:
realizationsfloat or sequence of float

The realizations of the distribution.

Notes

This method samples the barycentric coordinates, allowing to work in any dimension.

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> vertices = [[0, 1, 0, 2, 0, 0],
...             [1, 0, 2, 3, 1, 0],
...             [3, 4, 0, 0, 1, 2],
...             [2, 0, 2, 0, 1, 1],
...             [1, 3, 1, 4, 1, 5]]
>>> r = ot.DistFunc.rUniformSimplex(vertices)
>>> r = ot.DistFunc.rUniformSimplex(vertices, 10)