Voronoi

The VoronoiStrata class is imported using the following command:

>>> from UQpy.sampling.stratified_sampling.strata.VoronoiStrata import VoronoiStrata

Methods

class VoronoiStrata(seeds=None, seeds_number=None, dimension=None, decomposition_iterations=1, random_state=None)[source]

Define a geometric decomposition of the n-dimensional unit hypercube into disjoint and space-filling Voronoi strata.

Parameters:
  • seeds (Optional[ndarray]) – An array of dimension \(N * n\) specifying the seeds of all strata. The seeds of the strata are the coordinates of the point inside each stratum that defines the stratum. The user must provide seeds or seeds_number and dimension

  • seeds_number (Optional[int]) – The number of seeds to randomly generate. Seeds are generated by random sampling on the unit hypercube. The user must provide seeds or seeds_number and dimension

  • dimension (Optional[int]) – The dimension of the unit hypercube in which to generate random seeds. Used only if seeds_number is provided. The user must provide seeds or seeds_number and dimension

  • decomposition_iterations (int) – Number of iterations to perform to create a Centroidal Voronoi decomposition. If decomposition_iterations = 0, the Voronoi decomposition is based on the provided or generated seeds. If decomposition_iterations >= 1, the seed points are moved to the centroids of the Voronoi cells in each iteration and a new Voronoi decomposition is performed. This process is repeated decomposition_iterations times to create a Centroidal Voronoi decomposition.

stratify()[source]

Performs the Voronoi stratification.

static compute_voronoi_centroid_volume(vertices)[source]

This function computes the centroid and volume of a Voronoi cell from its vertices.

Parameters:

vertices – Coordinates of the vertices that define the Voronoi cell.

Returns:

Centroid and Volume of the Voronoi cell

add_boundary_points_and_construct_delaunay(samples_number, training_points)[source]

This method add the corners of \([0, 1]^n\) hypercube to the existing samples, which are used to construct a Delaunay Triangulation.

Attributes

VoronoiStrata.voronoi: Voronoi

Defines a Voronoi decomposition of the set of reflected points. When creating the Voronoi decomposition on the unit hypercube, the code reflects the points on the unit hypercube across all faces of the unit hypercube. This causes the Voronoi decomposition to create edges along the faces of the hypercube.

This object is not the Voronoi decomposition of the unit hypercube. It is the Voronoi decomposition of all points and their reflections from which the unit hypercube is extracted.

To access the vertices in the unit hypercube, see the attribute vertices.

VoronoiStrata.vertices: list

A list of the vertices for each Voronoi stratum on the unit hypercube.