mixle.doe.factorial module¶
Classical factorial, screening, and response-surface experiment designs.
These complement the space-filling generators in mixle.doe.designs with the structured “named”
designs of classical DOE: two-level fractional factorials and Plackett-Burman screening designs, and
the central-composite and Box-Behnken response-surface designs.
Every generator takes per-dimension bounds (a sequence of (low, high) pairs, one per factor)
and returns a (n_runs, d) array. The design is built in coded units – two-level factors at
-1 / +1, response-surface axial/centre points relative to that – then mapped into bounds
so -1 -> low, +1 -> high, 0 -> the midpoint. Pass coded=True to get the raw
coded matrix instead (the natural input to the analysis routines in mixle.doe.analysis).
- fractional_factorial(bounds, generators, *, coded=False)[source]
Two-level fractional factorial
2**(k-p)from pyDOE-style generator strings.generatorsnames one column per factor as a product of base factors, e.g."a b c ab ac"– a2**(5-2)design whose factorsd, eare deliberately aliased asd = ab,e = ac. Base factors are the distinct single letters; each token is the elementwise product of its letters, optionally negated with a leading-. The number of tokens must equallen(bounds).Returns a
(2**k, d)design (k= number of base factors) mapped intobounds– or the raw coded+/-1matrix ifcoded=True.
- plackett_burman(bounds, *, coded=False)[source]
Plackett-Burman two-level screening design for
len(bounds)factors.Returns
Nruns whereNis the smallest multiple of four that is at leastd + 1(so the design is saturated or near-saturated, ideal for screening many factors in few runs). ForNa power of two the design is a Hadamard matrix (a resolution-III fractional factorial); forNin{12, 20, 24}a known cyclic generator is used; otherwiseNis rounded up to the next power of two so a design always exists. Main effects are mutually orthogonal but aliased with two-factor interactions – use it to find the few large effects, then follow up with a fuller design.
- central_composite(bounds, *, center=4, alpha='rotatable', coded=False)[source]
Central-composite design (CCD) for fitting a full second-order response surface.
A CCD stacks three parts: the
2**dtwo-level factorial corners (estimate linear and interaction terms),2*daxial / star points at distancealphaon each axis (estimate the pure-quadratic curvature), andcenterreplicates at the centre (estimate pure error and curvature).alphasets the axial distance:"rotatable"(default) –alpha = (2**d)**0.25, so prediction variance depends only on distance from the centre;"orthogonal"– the value making the second-order terms orthogonal (depends oncenter);"face"(a face-centred CCD / CCF) –alpha = 1, keeping every run inside the cube;a positive float – used directly.
Returns
(2**d + 2*d + center, d)rows mapped intobounds(or coded ifcoded=True).
- box_behnken(bounds, *, center=None, coded=False)[source]
Box-Behnken response-surface design (3 levels per factor, no corner runs).
For every pair of factors it runs the four
(+/-1, +/-1)combinations with all other factors at the centre, pluscentercentre replicates. Unlike a CCD it never sets all factors to an extreme at once (no cube corners), which is useful when those combinations are expensive or infeasible, and it needs only three levels per factor. Requiresd >= 3.Returns
(4 * C(d, 2) + center, d)rows mapped intobounds(or coded ifcoded=True).