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:
- distribution
openturns.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, 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.
- distribution
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 . Considering the discrete measure , its energy is defined as
- 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 . Considering the discrete measure , its potential is defined for the characteristic energy-distance kernel of Székely and Rizzo
- 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 .
- Returns:
- potentialfloat
Energy of the measure defined by
- compute_target_potential()¶
Compute the potential of the target probability measure .
- Returns:
- potentialnumpy.array
Potential of the measure computed over the N-sized candidate set and defined for the characteristic energy-distance kernel of Székely and Rizzo by
- 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:
- design
openturns.Sample
Sample of all selected points
- design