latin_hypercube
latin_hypercube(n, dimension=1, seed=None, median=False)Latin hypercube sample of uniform [0, 1] probabilities.
Uses the same seeded Mersenne Twister stream as the C# LatinHypercube.Random, so a given seed reproduces the C# sample bit-for-bit (and matches corehydror exactly).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| n | int | Number of samples (rows). | required |
| dimension | int | Number of dimensions (columns). | 1 |
| seed | int | Seed for reproducible samples; None (the default) seeds from the clock. |
None |
| median | bool | If True, place each sample at the center of its bin (median LHS) instead of at a random position within it. | False |
Returns
| Name | Type | Description |
|---|---|---|
| numpy.ndarray | An (n, dimension) array of probabilities in (0, 1). |