sampling.mm.propose_mmphi_corrected_minimizing_point
sampling.mm.propose_mmphi_corrected_minimizing_point(
X,
n_candidates=1000,
q=2.0,
p=2.0,
seed=None,
lower=None,
upper=None,
normalize_flag=False,
)Proposes a new point that minimizes the corrected Morris-Mitchell criterion.
Samples n_candidates points uniformly at random within [lower, upper] and returns the one whose addition to X yields the lowest value of the corrected criterion :math:\hat{\Phi}_q (see :func:mmphi_corrected).
Internally the function pre-computes the base distance cache (J, d) for X once and then evaluates each candidate via :func:mmphi_corrected_update, which only needs to compute the n new distances between the candidate and the existing points rather than all :math:\binom{n+1}{2} pairwise distances. This makes the search :math:O(n) per candidate instead of :math:O(n^2).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| X | np.ndarray | Existing design points, shape (n_points, n_dim). |
required |
| n_candidates | int | Number of random candidate points to evaluate. Defaults to 1000. | 1000 |
| q | float | Exponent for the corrected Morris-Mitchell criterion. Defaults to 2.0. | 2.0 |
| p | float | Distance norm (e.g., p=1 Manhattan, p=2 Euclidean). Defaults to 2.0. | 2.0 |
| seed | int | Random seed for reproducibility. Defaults to None. | None |
| lower | np.ndarray | Lower bounds for each dimension, shape (n_dim,). Defaults to np.zeros(n_dim). |
None |
| upper | np.ndarray | Upper bounds for each dimension, shape (n_dim,). Defaults to np.ones(n_dim). |
None |
| normalize_flag | bool | If True, normalizes X and all candidate points to [0, 1] before computing distances. Defaults to False. |
False |
Returns
| Name | Type | Description |
|---|---|---|
| np.ndarray | np.ndarray: The best candidate point found, shape (1, n_dim). |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If any element of lower is greater than or equal to the corresponding element of upper. |
Examples
>>> import numpy as np
>>> from spotoptim.sampling.mm import propose_mmphi_corrected_minimizing_point
>>> X = np.array([[0.1, 0.2], [0.5, 0.5], [0.9, 0.8]])
>>> new_point = propose_mmphi_corrected_minimizing_point(
... X, n_candidates=200, q=2, p=2, seed=0
... )
>>> print(new_point.shape)
(1, 2)