Building a Design

First you will need to determine what kind of design suits your problem.

Screening Designs

These designs are meant to be run with many factors, and are used to determine which factors are important and which can be discarded. They typically have fewer runs and are meant to be used with a linear or interaction model.

Two-Level Factorial

Functions to build factorial designs.

build_factorial(factor_count, run_count)[source]

Builds a regular two-level design based on a number of factors and runs.

Full two-level factorial designs may be run for up to 9 factors. These designs permit estimation of all main effects and all interaction effects. If the number of runs requested is a 2^factor_count, the design will be a full factorial.

If the number of runs is less than 2^factor_count (it still must be a power of two) a fractional design will be created. Not all combinations of runs and factor counts will result in a design. Use the alias list method to see what terms are estimable in the resulting design.

Parameters:
  • factor_count (int) – The number of factors to build for.
  • run_count (int) – The number of runs in the resulting design. Must be a power of 2.
Returns:

A pandas.DataFrame object containing the requested design.

build_full_factorial(factor_count)[source]

Builds a full 2^K factorial design.

The resulting design will contain every combination of -1 and +1 for the number of factors given.

Response Surface Designs

Find the best settings for the factors with a goal to optimize the process. Use a Response Surface Optimal designs to algorithmically find the best runs to fit within multi-linear constraints, to custom polynomial models, and have more flexible blocking structures.

Central Composite

build_ccd(factor_count, alpha='rotatable', center_points=1)[source]

Builds a central composite design.

The most popular response surface method (RSM) design is the central composite design (CCD). A CCD has three groups of design points:

  1. two-level factorial or fractional factorial design points
  2. axial points (sometimes called “star” points)
  3. center points

CCDs are designed to estimate the coefficients of a quadratic model.

Factorial Points

The two-level factorial part of the design consists of all possible combinations of the +1 and -1 levels of the factors. For the two factor case there are four design points:

(-1, -1) (+1, -1) (-1, +1) (+1, +1)

Star or Axial Points

The star points have all of the factors set to 0, the midpoint, except one factor, which has the value +/- Alpha. For a two-factor problem, the star points are:

(-Alpha, 0) (+Alpha, 0) (0, -Alpha) (0, +Alpha)

The value for Alpha is calculated in each design for both rotatability and orthogonality of blocks. The experimenter can choose between these values or enter a different one. The default value is set to the rotatable value.

Another position for the star points is at the face of the cube portion on the design. This is commonly referred to as a face-centered central composite design. You can create this by setting the alpha distance to one, or setting the alpha parameter to “face centered”. This design only requires three levels for each factor.

Center Points

Center points, as implied by the name, are points with all levels set to coded level 0 - the midpoint of each factor range: (0, 0)

Center points are usually repeated 4-6 times to get a good estimate of experimental error (pure error).

To summarize, central composite designs require 5 levels of each factor: -Alpha, -1, 0, 1, and +Alpha. One of the commendable attributes of the central composite design is that its structure lends itself to sequential experimentation. Central composite designs can be carried out in blocks.

Categorical Factors

You may also add categorical factors to this design. This will cause the number of runs generated to be multiplied by the number of combinations of the categorical factor levels.

Parameters:
  • factor_count (integer) – The number of factors to build for.
  • alpha_type (integer or float) – The alpha to use for the axial points calculate. This can be either a float, in which case the “star” or “axial” points in the design will be placed at that distance. It can also be a string indicating the type of CCD to build e.g. “rotatable”.
  • center_points (integer) – The number of center points to include in the design.

Mixture Designs

Formulation work. If the process is a mixture, such as a drug formulation, a chemical composition, or even how to allocate a budget, then use a Mixture Design. These designs produce runs to model the responses in terms of the relative proportions of the components. The sum of the component proportions is always 1 (100% of the components being varied). As one component is increased the sum of the other components must decrease to maintain the sum. Mixture optimal designs are most commonly used because they allow the most flexibility in your component ranges.

Simplex Lattice

build_simplex_lattice(factor_count, model_order=<ModelOrder.quadratic: 2>)[source]

Builds a Simplex Lattice mixture design.

This design can be used for 2 to 30 components. A simplex-lattice mixture design of degree m consists of m+1 points of equally spaced values between 0 and 1 for each component. If m = 2 then possible fractions are 0, 1/2, 1. For m = 3 the possible values are 0, 1/3, 2/3, 1. The points include the pure components and enough points between them to estimate an equation of degree m. This design differs from a simplex-centroid design by having enough points to estimate a full cubic model.

Parameters:
  • factor_count (int) – The number of mixture components to build for.
  • model_order (dexpy.model.ModelOrder) – The order to build for. ModelOrder.linear will choose vertices only (pure blends). ModelOrder.quadratice will add binary blends, and ModelOrder.cubic will add blends of three components.

Simplex Centroid

build_simplex_centroid(factor_count)[source]

Builds a Simplex Centroid mixture design.

This mixture design can be used for 3 to 8 components. A simplex-centroid design consists of all points that are equally weighted mixtures of 1 to q components. Included are permutations of:

Pure blends: (1, 0, …,0)

Binary blends: (1/2, 1/2, 0, …,0)

Tertiary blends: (1/3, 1/3, 1/3, 0, …,0)

and so on to the overall centroid: (1/q, 1/q, …, 1/q).

This design differs from a simplex-lattice design. It cannot be used to estimate the full cubic model, but can be used to estimate a special cubic model.

Parameters:factor_count (int) – The number of mixture components to build for.

Optimal Designs

Optimal designs are designs built algorithmically to satisfy some criteria (e.g. D-optimality).

build_optimal(factor_count, **kwargs)[source]

Builds an optimal design.

This uses the Coordinate-Exchange algorithm from Meyer and Nachtsheim 1995 [1].

Parameters:

factor_count (integer) – The number of factors to build for.

Keyword Arguments:
 
  • order (ModelOrder) –
    Builds a design for this order model. Mutually exclusive with the model parameter.
  • model (patsy formula) –
    Builds a design for this model formula. Mutually exclusive with the order parameter.
  • run_count (integer) –
    The number of runs to use in the design. This must be equalto or greater than the rank of the model.

References

[1]R.K. Meyer and C.J. Nachtsheim. The coordinate-exchange algorithm for constructing exact optimal experimental designs. Technometrics, 37(1):60–90, 1995.