sampling.mm.mmphi_intensive

sampling.mm.mmphi_intensive(X, q=2.0, p=2.0, normalize_flag=False)

Calculates a size-invariant Morris-Mitchell criterion.

This “intensive” version of the criterion allows for the comparison of sampling plans with different sample sizes by normalizing for the number of point pairs. A smaller value indicates a better (more space-filling) design.

Parameters

Name Type Description Default
X np.ndarray A 2D array representing the sampling plan (shape: (n, d)). 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 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: - intensive_phiq: The intensive space-fillingness metric. - J: Multiplicities of distances. - d: Unique distances.

Examples

>>> import numpy as np
>>> from spotoptim.sampling.mm import mmphi_intensive
>>> # Create a simple 3-point sampling plan in 2D
>>> X = np.array([
...     [0.0, 0.0],
...     [0.5, 0.5],
...     [1.0, 1.0]
... ])
>>> # Calculate the intensive space-fillingness metric with q=2, using Euclidean distances (p=2)
>>> quality, J, d = mmphi_intensive(X, q=2, p=2)
>>> print(quality)