sampling.mm.plot_mmphi_corrected_vs_n_lhs
sampling.mm.plot_mmphi_corrected_vs_n_lhs(
k_dim,
seed,
n_min=10,
n_max=100,
n_step=5,
q_phi=2.0,
p_phi=2.0,
plot_only_corrected=False,
)Generate LHS designs for varying n and plot the Corrected Morris-Mitchell Criterion against the standard criterion.
For each sample size n in range(n_min, n_max + 1, n_step) a fresh Latin Hypercube design is drawn and both the intensive criterion hat_Phi_q^I (normalized by M = n(n-1)/2) and the corrected criterion hat_Phi_q (normalized by n^{1+q/k}) are computed. The two series are displayed on a shared x-axis with independent y-axes so their trends can be compared directly.
When plot_only_corrected is True, the intensive criterion is omitted: only hat_Phi_q is plotted on a single y-axis. This is the preferred form when illustrating the asymptotic size-invariance of the corrected criterion on its own scale.
The corrected criterion is asymptotically size-invariant: for large n its expected value stabilizes at a finite constant that depends only on the spatial distribution of the design, not on n itself. This plot makes that convergence behaviour visible.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| k_dim | int | Number of dimensions for the LHS design. | required |
| seed | int | Random seed for reproducibility. | required |
| n_min | int | Minimum number of samples. Defaults to 10. | 10 |
| n_max | int | Maximum number of samples. Defaults to 100. | 100 |
| n_step | int | Step size for increasing n. Defaults to 5. | 5 |
| q_phi | float | Exponent q for the Morris-Mitchell criteria. Defaults to 2.0. | 2.0 |
| p_phi | float | Distance norm p for the Morris-Mitchell criteria. Defaults to 2.0. | 2.0 |
| plot_only_corrected | bool | If True, plot only the corrected criterion hat_Phi_q on a single y-axis and skip the intensive criterion entirely. Defaults to False, which preserves the original dual-axis comparison plot. |
False |
Returns
| Name | Type | Description |
|---|---|---|
| None | None | Displays the plot. When plot_only_corrected is False the |
| None | figure has dual y-axes showing mmphi_intensive and |
|
| None | mmphi_corrected; when True only the corrected curve is shown. |
Examples
>>> from spotoptim.sampling.mm import plot_mmphi_corrected_vs_n_lhs
>>> plot_mmphi_corrected_vs_n_lhs(k_dim=3, seed=42, n_min=10, n_max=50, n_step=5, q_phi=2.0, p_phi=2.0)
>>> plot_mmphi_corrected_vs_n_lhs(k_dim=3, seed=42, n_min=10, n_max=50, plot_only_corrected=True)