helpers.WilliamsTransform

helpers.WilliamsTransform(arr, baseline=0, modified=False)

Williams Transformation

Parameters

Name Type Description Default
arr numpy.numpy.ArrayLike A numpy ndarray required
baseline int A integer, which defines the minimum value for each column of the matrix. Defaults to 0. 0
modified (bool, optional) Implement modifed version of Williams Transformation. Defaults to False. False

Returns

Type Description
numpy.numpy.ndarray After applying Williams transformation, a matrix whose columns are permutations from {baseline,baseline+1, …, baseline+(n-1)}. For the modified version. Whenever n is odd, n=2m+1 the columns will be permutations will always be even numbers

Examples:

import pyLHD
x = pyLHD.GoodLatticePoint(size = (7,6))
x
array([[1, 2, 3, 4, 5, 6],
       [2, 4, 6, 1, 3, 5],
       [3, 6, 2, 5, 1, 4],
       [4, 1, 5, 2, 6, 3],
       [5, 3, 1, 6, 4, 2],
       [6, 5, 4, 3, 2, 1],
       [0, 0, 0, 0, 0, 0]])

Apply Williams Transformation, with baseline =0 the column level permutations will be (0,1,2,…,6)

pyLHD.WilliamsTransform(x)
array([[2, 4, 6, 5, 3, 1],
       [4, 5, 1, 2, 6, 3],
       [6, 1, 4, 3, 2, 5],
       [5, 2, 3, 4, 1, 6],
       [3, 6, 2, 1, 5, 4],
       [1, 3, 5, 6, 4, 2],
       [0, 0, 0, 0, 0, 0]])

Apply modified Williams Transformation, with baseline =0 the column level permutations will be (0,2,4,6)

pyLHD.WilliamsTransform(x, modified = True)
array([[2, 4, 6, 6, 4, 2],
       [4, 6, 2, 2, 6, 4],
       [6, 2, 4, 4, 2, 6],
       [6, 2, 4, 4, 2, 6],
       [4, 6, 2, 2, 6, 4],
       [2, 4, 6, 6, 4, 2],
       [0, 0, 0, 0, 0, 0]])