polynomials_on_simplices.probability_theory.uniform_sampling module

Uniform sampling of random points in different geometries.

closed_unit_interval_sample()[source]

Generate a random number sampled from the uniform distribution over the closed unit interval [0, 1].

Returns:Random number.
closed_unit_interval_sampling(num_points)[source]

Uniform random sampling of points in the closed unit interval [0, 1].

Parameters:num_points – Number of points to sample.
Returns:List of random points.
left_closed_interval_sample()[source]

Generate a random number sampled from the uniform distribution over the left closed unit interval [0, 1).

Returns:Random number.
left_closed_unit_interval_sampling(num_points)[source]

Uniform random sampling of points in the unit interval [0, 1).

Parameters:num_points – Number of points to sample.
Returns:List of random points.
ncube_sampling(n, num_points)[source]

Uniform random sampling of points in the n-dimensional unit cube \([0, 1)^n\).

Parameters:
  • n – Dimension of cube.
  • num_points – Number of points to sample.
Returns:

List of random points.

nsimplex_sampling(n, num_points)[source]

Uniform random sampling of points inside the n-dimensional unit simplex.

See polynomials_on_simplices.geometry.primitives.simplex.unit().

Parameters:
  • n – Dimension of the simplex.
  • num_points – Number of points to sample.
Returns:

List of random points.

nsphere_sampling(n, num_points)[source]

Uniform random sampling of points in the n-dimensional unit sphere \(\{x \in \mathbb{R}^n : \|x\| \leq 1\}\).

Parameters:
  • n – Dimension of sphere.
  • num_points – Number of points to sample.
Returns:

List of random points.

nsphere_surface_sampling(n, num_points)[source]

Uniform random sampling of points on the surface of the n-dimensional unit sphere (\(\partial B^n = S^{n-1}\)).

Parameters:
  • n – Dimension of sphere.
  • num_points – Number of points to sample.
Returns:

List of random points.

open_unit_interval_sample()[source]

Generate a random number sampled from the uniform distribution over the open unit interval (0, 1).

Returns:Random number.
open_unit_interval_sampling(num_points)[source]

Uniform random sampling of points in the unit interval (0, 1).

Parameters:num_points – Number of points to sample.
Returns:List of random points.
right_closed_interval_sample()[source]

Generate a random number sampled from the uniform distribution over the right closed unit interval (0, 1].

Returns:Random number.
right_closed_unit_interval_sampling(num_points)[source]

Uniform random sampling of points in the unit interval (0, 1].

Parameters:num_points – Number of points to sample.
Returns:List of random points.
unit_circle_sampling(num_points)[source]

Uniform random sampling of points on the unit circle (\(S^1\)).

Parameters:num_points – Number of points to sample.
Returns:List of random points.
unit_disc_sampling(num_points)[source]

Uniform random sampling of points in the unit disc \(\{x \in \mathbb{R}^2 : \|x\| \leq 1\}\).

Parameters:num_points – Number of points to sample.
Returns:List of random points.
unit_interval_sampling(num_points)[source]

Uniform random sampling of points in the unit interval [0, 1).

Parameters:num_points – Number of points to sample.
Returns:List of random points.
unit_square_sampling(num_points)[source]

Uniform random sampling of points in the unit square [0, 1) x [0, 1).

Parameters:num_points – Number of points to sample.
Returns:List of random points.