orthogonal.OLHD_Butler01

orthogonal.OLHD_Butler01(size, seed=None)

Orthogonal Latin Hypercube Design (OLHD). Based on the construction method of Butler (2001)

Parameters

Name Type Description Default
size tuple of ints Output shape of (n,d), where n and d are the number of rows and columns, respectively. required
seed Optional[Union[int, np.random.Generator]]) If seedis an integer or None, a new numpy.random.Generator is created using np.random.default_rng(seed). If seed is already a `Generator instance, then the provided instance is used. Defaults to None. None

Raises

Type Description
ValueError If d is not less than or equal to n
ValueError If n is not greater than or equal to 3
ValueError If n is not an odd prime number

Returns

Type Description
numpy.numpy.ndarray A (n x d) orthogonal LHD

Examples: Create an orthogonal LHD with 11 rows and 5 columns

import pyLHD
pyLHD.OLHD_Butler01(size = (11,5))
array([[ 3.,  4.,  2.,  1.,  5.],
       [11.,  2.,  3.,  7.,  8.],
       [ 4.,  1.,  7., 10.,  3.],
       [ 5.,  3., 11.,  4., 10.],
       [10.,  5.,  8.,  3.,  1.],
       [ 2.,  7.,  4.,  9., 11.],
       [ 7.,  9.,  1.,  8.,  2.],
       [ 8., 11.,  5.,  2.,  9.],
       [ 1., 10.,  9.,  5.,  4.],
       [ 9.,  8., 10., 11.,  7.],
       [ 6.,  6.,  6.,  6.,  6.]])

Create an orthogonal LHD with 7 rows and 6 columns

 pyLHD.OLHD_Butler01(size = (7,6))
array([[2., 1., 3., 3., 7., 5.],
       [1., 5., 6., 5., 2., 6.],
       [3., 6., 1., 7., 5., 2.],
       [5., 2., 7., 6., 4., 3.],
       [7., 3., 2., 4., 3., 7.],
       [6., 7., 5., 2., 6., 4.],
       [4., 4., 4., 1., 1., 1.]])