nextorch.doe

Generates initial design of experiment (DOE)

Includes full factorial design, latin hypercube design and random design

nextorch.doe.full_factorial(levels: List[int]) nextorch.doe.Matrix

Generates full factorial design

Parameters

levels (list of int) – Each number is a discrete level of each independent variable m is the number of variables or the size of the list

Returns

X_unit – Normalized sampling plan with the shape of prod(level_i) * m

Return type

Matrix

nextorch.doe.latin_hypercube(n_dim: int, n_points: int, seed: Optional[int] = None, criterion: Optional[str] = None) nextorch.doe.Matrix

Generates latin hypercube design

Parameters
  • n_dim (int) – Number of independent variables

  • n_points (int) – Total number of points in the design

  • seed (Optional[int], optional) – Random seed, by default None

  • criterion (Optional[str], optional) – String that tells lhs how to sample the points, by default None which simply randomizes the points within the intervals. Other options: “center”, “maximin”, “centermaximin”, or “correlation” See https://pythonhosted.org/pyDOE/randomized.html for details.

Returns

X_unit – Normalized sampling plan with the shape of n_point * n_dim

Return type

Matrix

nextorch.doe.norm_transform(X_norm: nextorch.doe.Matrix, means: List[float], stdvs: List[float]) nextorch.doe.Matrix

Transform designs into normal distribution

Parameters
  • X_norm (Matrix) – Original design matrix with the shape of n_points*n_dim

  • means (list of float) – Means of the target distributions, size of n_dim

  • stdvs (list of float) – Standard deviations of the target distributions, size of n_dim

Returns

X_transformed – Transformed sampling plan with the shape of n_points*n_dim

Return type

Matrix

nextorch.doe.randomized_design(n_dim: int, n_points: int, seed: Optional[int] = None) nextorch.doe.Matrix

Generates completely randomized design

Parameters
  • n_dim (int) – Number of independent variables

  • n_points (int) – Total number of points in the design

  • seed (Optional[int], optional) – Random seed, by default None

Returns

X_norm – Normalized sampling plan with the shape of n_point * n_dim

Return type

Matrix

nextorch.doe.randomized_design_w_levels(levels: List[int], seeds: Optional[List[int]] = None) nextorch.doe.Matrix

Generates randomized design with levels in each dimension

Parameters
  • levels (list of int) – Each number is a discrete level of each independent variable m is the number of variables or the size of the list

  • seeds (Optional[list of int], optional) – List of random seeds, same size as levels, by default None

Returns

X_unit – Normalized sampling plan with the shape of prod(level_i) * m

Return type

Matrix