src/estimagic/optimization/trust_region_sampling.py
def _create_upscaled_lhs_sample(n_dim, n_points, n_designs, dtype=np.uint8):
    """Create an upscaled Latin hypercube sample (LHS).

    Args:
        n_dim (int): Dimensionality of the problem.
        n_points (int): Number of sample points.
        n_designs (int): Number of different hypercubes to sample.
        dtype (np.uint8 or np.unt16): Data type of arrays. Default np.unint8.

    Returns:
        sample (np.ndarray): Latin Hypercube sample of shape (n_designs, n_samples,
            n_dim)

    """
    index = np.arange(n_points, dtype=dtype)
    sample = np.empty((n_designs, n_dim, n_points), dtype=dtype)

    for i, j in itertools.product(range(n_designs), range(n_dim)):
        np.random.shuffle(index)
        sample[i, j] = index

    sample = np.swapaxes(sample, 1, 2)
    return sample
Create an upscaled Latin hypercube sample (LHS).

    Args:
        n_dim (int): Dimensionality of the problem.
        n_points (int): Number of sample points.
        n_designs (int): Number of different hypercubes to sample.
        dtype (np.uint8 or np.unt16): Data type of arrays. Default np.unint8.

    Returns:
        sample (np.ndarray): Latin Hypercube sample of shape (n_designs, n_samples,
            n_dim)

    
Create an upscaled Latin hypercube sample (LHS).
Create an upscaled Latin hypercube sample ( LHS ) .
def _create_upscaled_lhs_sample(n_dim, n_points, n_designs, dtype=np.uint8):
    index = np.arange(n_points, dtype=dtype)
    sample = np.empty((n_designs, n_dim, n_points), dtype=dtype)
    for i, j in itertools.product(range(n_designs), range(n_dim)):
        np.random.shuffle(index)
        sample[i, j] = index
    sample = np.swapaxes(sample, 1, 2)
    return sample
def _create_upscaled_lhs_sample ( n_dim , n_points , n_designs , dtype = np . uint8 ) : index = np . arange ( n_points , dtype = dtype ) sample = np . empty ( ( n_designs , n_dim , n_points ) , dtype = dtype ) for i , j in itertools . product ( range ( n_designs ) , range ( n_dim ) ) : np . random . shuffle ( index ) sample [ i , j ] = index sample = np . swapaxes ( sample , 1 , 2 ) return sample
Create an upscaled Latin hypercube sample (LHS).
Create an upscaled Latin hypercube sample ( LHS ) .
"""Create an upscaled Latin hypercube sample (LHS).

    Args:
        n_dim (int): Dimensionality of the problem.
        n_points (int): Number of sample points.
        n_designs (int): Number of different hypercubes to sample.
        dtype (np.uint8 or np.unt16): Data type of arrays. Default np.unint8.

    Returns:
        sample (np.ndarray): Latin Hypercube sample of shape (n_designs, n_samples,
            n_dim)

    """
sample (np.ndarray): Latin Hypercube sample of shape (n_designs, n_samples,
n_dim)
sample ( np . ndarray ) : Latin Hypercube sample of shape ( n_designs n_samples n_dim )
n_dim
Dimensionality of the problem.
Dimensionality of the problem .
n_points
Number of sample points.
Number of sample points .
n_designs
Number of different hypercubes to sample.
Number of different hypercubes to sample .
dtype
Data type of arrays. Default np.unint8.
Data type of arrays . Default np . unint8 .