criteria.discrepancy

criteria.discrepancy(arr, method='centered_L2')

Discrepancy of a given sample

Parameters

Name Type Description Default
arr numpy.numpy.ArrayLike A numpy ndarray required
method str Type of discrepancy. Defaults to ‘centered_L2’. Options include: ‘L2’, ‘L2_star’,‘centered_L2’, ‘modified_L2’, ‘mixture_L2’, ‘symmetric_L2’, ‘wrap_around_L2’ 'centered_L2'

Raises

Type Description
ValueError Whenever number of rows is less than number of columns

Returns

Type Description
float Desired discrepancy type

Examples: Calculate the centered_L2 discrepancy of random_lhd

import pyLHD
random_lhd = pyLHD.LatinHypercube(size = (10,3))
pyLHD.discrepancy(random_lhd)
0.1521212129165316

Calculate the L2 star discrepancy of random_lhd

pyLHD.discrepancy(random_lhd,method='L2_star')
0.060507544910597524