mldoe module¶
Design classes¶
This section describes the two main classes of the module:
Two-Level Design class (TLD)
Mixed-Level Design class (MLD)
In both classes the design is defined by its run size (it must be a power of two) and the numbers of the columns used for its factors.
Each column numbers uniquely defines a generator, by the factors it used. Powers of two are independent factors while other numbers are combinations of independent factors. To known which factor are used in a generator, simply decompose it into powers of 2. For example \(7=3+2+1\) so the generator represented by column 7 is composed of the independent factors 1, 2 and 3, and we can write \(7=123\). All the possible generators formed by \(r\) basic factors can be summarized by the \(r \times 2^{r}-1\) matrix called the reduced design matrix. Below is the reduced design matrix for four basic factors.
Here is how we create a four-level factor
Matrix functions¶
- src.mldoe.matrix.bmat(r: int, alt_coding: bool = False) → numpy.array¶
Create the full-interaction matrix (B) for \(r\) basic factors.
The B matrix is a \(2^r\) by \(2^r-1\) matrix with the \(2^r-1\) interactions of the columns representing the \(r\) basic factors.
- Parameters
r (int) – number of basic factors
alt_coding (bool) – use (-1,+1) coding instead of (0,1) coding. Default to False (0,1).
- Returns
full-interaction matrix
- Return type
numpy.array
- src.mldoe.matrix.gmat(r: int, alt_coding: bool = False) → numpy.array¶
Create the reduced interaction (G) matrix for \(r\) basic factors.
The G matrix is a \(r\) by \(2^r-1\) matrix where each column represents an interaction and each row represents a basic factor. An entry of 1 means that the \(i\)-th basic factor is used in the \(j\)-th interaction.
- Parameters
r (int) – number of basic factors
alt_coding (bool) – use (-1,+1) coding instead of (0,1) coding. Default to False (0,1).
- Returns
reduced interaction matrix
- Return type
numpy.array
- src.mldoe.matrix.rmat(r: int, alt_coding: bool = False) → numpy.array¶
Create the basic factor matrix (R) for \(r\) basic factors.
The R matrix is a \(2^r\) by \(r\) matrix where each column represents a basic factor and each row represents a run. The columns are ordered such that ith columns is a repetition of \(2^{(r-i)}\) zeros and \(2^{(r-i)}\) ones.
- Parameters
r (int) – number of basic factors
alt_coding (bool) – use (-1,+1) coding instead of (0,1) coding. Default to False (0,1).
- Returns
basic factor matrix
- Return type
numpy.array
Tools functions¶
References¶
- 2009
Xu, H. (2009). Algorithmic construction of efficient fractional factorial designs with large run sizes. Technometrics, 51(3), 262-277.
- 1989
Wu, C. F. J. (1989). Construction of 2m4 n designs via a grouping scheme. The Annals of Statistics, 1880-1885.