orthogonal.OA2LHD

orthogonal.OA2LHD(arr, seed=None)

Transform an Orthogonal Array (OA) into an LHD

Parameters

Name Type Description Default
arr numpy.numpy.ndarray An orthogonal array matrix 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

Returns

Type Description
numpy.numpy.ndarray LHD whose sizes are the same as input OA. The assumption is that the elements of OAs must be positive

Examples: First create an OA(9,2,3,2)

import numpy as np
example_OA = np.array([[1,1],[1,2],[1,3],[2,1],
                       [2,2],[2,3],[3,1],[3,2],[3,3] ])

Transform the “OA” above into a LHD according to Tang (1993)

import pyLHD
pyLHD.OA2LHD(example_OA)      
array([[1, 2],
       [2, 5],
       [3, 9],
       [6, 3],
       [5, 4],
       [4, 7],
       [9, 1],
       [8, 6],
       [7, 8]])