sampling.mm.mmphi_corrected
sampling.mm.mmphi_corrected(X, q=2.0, p=2.0, normalize_flag=False)Calculates the corrected, dimension-aware Morris-Mitchell criterion.
This criterion is size-invariant by normalizing the standard Morris-Mitchell criterion by :math:n^{1+q/k}, where n is the number of design points and k is the dimension of the design space. It is defined as:
.. math::
\hat{\Phi}_q(P)
= \left(\frac{\sum_{j=1}^{m} J_j\, d_j^{-q}}{n^{1+q/k}}\right)^{1/q}
= \frac{\Phi_q(P)}{n^{1/q+1/k}}
Unlike the standard criterion :math:\Phi_q (which always increases with n) and the intensive criterion :math:\Phi_q^{*} (which increases for :math:q > k), :math:\hat{\Phi}_q is asymptotically size-invariant and decreases when an optimally placed point is added for sufficiently large n.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| X | np.ndarray | A 2D array representing the sampling plan (shape: (n, k)). | required |
| q | float | The exponent used in the computation of the metric. Defaults to 2.0. | 2.0 |
| p | float | The distance norm to use (e.g., p=1 for Manhattan, p=2 for Euclidean). Defaults to 2.0. | 2.0 |
| normalize_flag | bool | If True, normalizes the X array to [0, 1] before computing distances. Defaults to False. | False |
Returns
| Name | Type | Description |
|---|---|---|
| tuple[float, np.ndarray, np.ndarray] | tuple[float, np.ndarray, np.ndarray]: A tuple containing: - corrected_phiq (float): The corrected space-fillingness metric. Smaller values indicate better (more space-filling) designs. Returns np.inf for degenerate inputs (fewer than 2 unique points). - J (np.ndarray): Multiplicities of the unique distances. - d (np.ndarray): Unique pairwise distances. |
Examples
>>> import numpy as np
>>> from spotoptim.sampling.mm import mmphi_corrected
>>> # Simple 3-point sampling plan in 2D
>>> X = np.array([
... [0.0, 0.0],
... [0.5, 0.5],
... [1.0, 1.0]
... ])
>>> phi_hat, J, d = mmphi_corrected(X, q=2, p=2)
>>> print(phi_hat)