factorial_DOE#

obsidian.experiment.utils.factorial_DOE(d: int, n_CP: int = 3, shuffle: bool = True, seed: Generator | int | None = None, full: bool = False)[source]#

Creates a statistically designed factorial experiment (DOE). Specifically for 2-level designs only. Uses the range (0,1) for low-high instead of the typical (-1,1), although (-1,1) is used for calculations during alias design.

For n-level designs (3-level, 4-level, etc.), use factorial_DOE_n_level.

Parameters:
  • d (int) – Number of dimensions/inputs in the design.

  • n_CP (int, optional) – The number of centerpoints to include in the design, for estimating uncertainty and curvature. Default is 3.

  • shuffle (bool, optional) – Whether or not to shuffle the design or leave them in the default run order. Default is True.

  • seed (Generator | int | None, optional) – Controls the run-order shuffle. A Generator is used directly; an int seeds an isolated default_rng (reproducible, without touching global RNG state); None (default) defers to the ambient global np.random stream (e.g. one set by with_tmp_seed). Global state is never reseeded.

  • full (bool, optional) – Whether or not to run the full DOE. Default is False, which will lead to an efficient Res4+ design.

Returns:

An (m)-by-(d) array of experiments in the (0,1) domain

Return type:

ndarray

Raises:
  • UnsupportedError – If the number of dimensions exceeds 12

  • ValueError – If d < 1 or n_CP < 0