GreedySupportPoints

class otkerneldesign.GreedySupportPoints(distribution=None, candidate_set_size=None, candidate_set=None, initial_design=None)

Incrementally select new design points with greedy support points. Support points use a specific kernel, the energy-distance kernel.

Parameters:
distributionopenturns.Distribution

Distribution the design points must represent. If not specified, then candidate_set must be specified instead. Even if candidate_set is specified, can be useful if it allows the use of analytical formulas.

candidate_set_sizepositive int

Size of the set of all candidate points. Unnecessary if candidate_set is specified. Otherwise, 2^{12} by default.

candidate_set2-d list of float

Large sample that empirically represents a distribution. If not specified, then distribution and candidate_set_size must be in order to generate it automatically.

initial_design2-d list of float

Sample of points that must be included in the design. Empty by default.

Examples

>>> import openturns as ot
>>> import otkerneldesign as otkd
>>> distribution = ot.ComposedDistribution([ot.Normal(0.5, 0.1)] * 2)
>>> # Greedy support points design
>>> sp = otkd.GreedySupportPoints(distribution=distribution)
>>> sp_design = sp.select_design(20)

Methods

compute_current_energy(design_indices)

Compute the energy of the discrete measure defined by the design \mat{X}_n. Considering the discrete measure \zeta_n = \frac{1}{n} \sum_{i=1}^{n} \delta(\vect{x}^{(i)}), its energy is defined as

E_{\zeta_n} := \frac{1}{n^2} \sum_{i=1}^{n} \sum_{j=1}^{n} k(\vect{x}^{(i)}, \vect{x}^{(j)}).

Parameters:
design_indiceslist of positive int

List of the indices of the selected points in the Sample of candidate points

Returns:
potentialfloat

Energy of the discrete measure defined by the design

compute_current_potential(design_indices)

Compute the potential of the discrete measure (a.k.a, kernel mean embedding) defined by the design \vect{X}_n. Considering the discrete measure \zeta_n = \frac{1}{n} \sum_{i=1}^{n} \delta(\vect{x}^{(i)}), its potential is defined for the characteristic energy-distance kernel of Székely and Rizzo

P_{\zeta_n}(x) = \frac{1}{n} \sum_{i=1}^{n} k(\vect{x}, \vect{x}^{(i)})
                = \frac{1}{n} \sum_{i=1}^{n} \|\vect{x}-\vect{x}^{(i)}\|.

Parameters:
design_indiceslist of positive int

List of the indices of the selected points in the Sample of candidate points

Returns:
potentialnumpy.array

Potential of the discrete measure defined by the design (a.k.a, kernel mean embedding)

compute_distance_matrix(batch_nb=8)

Compute the matrix of pair-wise Euclidean distances between all candidate points. To avoid saturating the memory, this symmetric matrix is computed by blocks and using half-precision floating-point format (e.g., numpy.float16).

Parameters:
batch_nbpositive int

Number of blocks used to compute the symmetric matrix of distances. By default set to 8.

Returns:
distances2-d numpy array

Squared and symmetric matrix of distances between all the couples of points in the candidate set.

compute_target_energy()

Compute the energy of the target probability measure \mu.

Returns:
potentialfloat

Energy of the measure \mu defined by

E_{\mu} := \int \int k(\vect{x}, \vect{x}') d \mu(\vect{x}) d \mu(\vect{x}').

compute_target_potential()

Compute the potential of the target probability measure \mu.

Returns:
potentialnumpy.array

Potential of the measure \mu computed over the N-sized candidate set and defined for the characteristic energy-distance kernel of Székely and Rizzo by

P_{\mu}(x) := \int k(x, x') d \mu(x')
             = \frac{1}{N} \sum_{k=1}^N \|\vect{x}-\vect{x}'^{(k)}\|.

draw_energy_convergence(design_indices)

Draws the convergence of the energy for a set of points selected among the candidate set.

Parameters:
design_indiceslist of positive int

List of the indices of the selected points in the Sample of candidate points

Returns:
figmatplotlib.Figure

Energy convergence of the design of experiments

plot_datadata used to plot the figure
select_design(size)

Select a design with greedy support points.

Parameters:
sizepositive int

Number of points to be selected

Returns:
designopenturns.Sample

Sample of all selected points