mixtureDOE
Description
A mixtureDOE object contains a design for a mixture experiment,
and additional information about the design, model, and algorithm used to generate the design.
The elements of a run in a mixture design sum to one. Use the properties of a
mixtureDOE object to investigate the relative effects of a set of factors
on a response variable.
Creation
Syntax
Description
generates a mixture design for dmix = mixtureDOE(n)n factors and returns the design
information in a mixtureDOE object dmix.
specifies the number of factors and the bounds for the design runs. The elements of
dmix = mixtureDOE(bounds)bounds must be between 0 and 1.
specifies additional options using one or more name-value arguments. For example, you can
specify the experiment model and the algorithm used to generate the design runs.dmix = mixtureDOE(___,Name=Value)
Input Arguments
Number of factors in the design, specified as a positive integer.
Data Types: single | double
Factor bounds, specified as a 2-by-n
matrix, where n is the number of factors in the design. Each column
of bounds corresponds to a factor. The first row of
bounds contains the lower bounds for the factors, and
the second row contains the upper bounds.
The sum of the lower bounds for a mixture design must be less than or equal to one. The sum of the upper bounds must be greater than or equal to one.
This argument sets the Bounds
property.
Example: [0.1 0.1 0; 0.5 0.7 0.7]
Data Types: single | double
Linear inequality constraints, specified as an
m-by-n matrix, where n is
the number of factors in the design and m is the number of
constraints. You must also specify b when you specify
A.
When you specify A and b,
mixtureDOE uses the following constraints to calculate the
design runs:
A(i,1)*Factor1+A(i,2)*Factor2+...+A(i,n)*FactorN≤b(i)
You can reverse the direction of the sign in the inequality by multiplying the
elements of A and b by
–1.
This argument sets the LinearConstraints
property.
Example: A=[0.3 5 100; 0.1 7 90; 0.25 2 180]
Data Types: single | double
Linear inequality constraints, specified as a numeric vector with
m elements, where m is the number of
constraints. You must also specify A when you specify
b.
When you specify b and A,
mixtureDOE uses the following constraints to calculate the
design runs:
A(i,1)*Factor1+A(i,2)*Factor2+...+A(i,n)*FactorN≤b(i)
You can reverse the direction of the sign in the inequality by multiplying the
elements of A and b by
–1.
This argument sets the LinearConstraints
property.
Example: b=[1 5 2]
Data Types: single | double
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: mixtureDOE(3,A,b,Degree=1,FactorNames=["drug1","drug2","drug3"])
specifies the factor names and degree for a design with three factors and linear
constraints.
Degree of the design, specified as a positive integer. Together with the
Method name-value argument, Degree
controls the number and location of the design runs. The possible values for
Degree depend on the value of Method.
Method | Values for Degree | Number of Design Runs |
|---|---|---|
"simplex-centroid" | 1 to n |
|
"simplex-lattice" | Integers greater than 0 |
|
"extreme-vertices" | 0 to n – 2 | mixtureDOE uses the shape of the design space
to iteratively calculate design runs. The degree of the design specifies
the number of iterations in the calculation. For more information, see
Method. |
In the above table, n is the number of factors in the design
and d is the degree of the design. The default value for
Degree is 0 when
Method is "extreme-vertices", and
n otherwise.
This argument sets the Degree
property.
Example: Degree=5
Data Types: single | double
Factor names, specified as a string vector or a cell array of character vectors.
If you specify ModelSpecification as a character vector or
string scalar formula in Wilkinson Notation, then FactorNames must
contain only valid variable names.
Example: FactorNames=["compound1","compound2"]
Data Types: char | string | cell
Algorithm for generating the mixture design, specified as one of the following values.
| Value | Description |
|---|---|
"simplex-centroid" | This method generates design runs that contain elements equal to 0, 1, or a fraction. The fraction elements of a run are equal to each other, have numerators equal to 1, and have denominators less than or equal to the number of factors in the model. For example, a
design with three factors includes the runs |
"simplex-lattice" | This method generates design runs that contain elements equal to 0, 1, or a fraction. The fraction elements of a run have denominators less than or equal to the number of factors in the model. For example, a design with three factors includes the
runs |
"extreme-vertices" | This method uses the shape of the design space to generate runs for the design. The design space is a polygon whose elements satisfy the bounds and linear constraints for the mixture design. The design includes the runs located at the corners
and center of the design space.
You can specify the degree
d of the design by using the
|
When you pass the bounds input argument to
mixtureDOE, the supported values for
Method depend on the type of bounds you specify.
When you specify only lower bounds by setting all upper bounds equal to
1,Methodcan be any value listed in the table above, and the default value is"simplex-centroid".When you specify only upper bounds by setting all lower bounds equal to
0, the value forMethoddepends on whether the design has an implied lower bound. The design has an implied lower bound if the sum of all the upper bounds minus the smallest upper bound is less than 1.No implied lower bound —
Methodcan be any value listed in the table above, and the default value is"simplex-centroid".Implied lower bound —
Methodmust be"extreme-vertices".
The default value for Method is
"simplex-centroid" when you specify n, and
"extreme-vertices" when you specify A and
b.
This argument sets the Method
property.
Example: Method="simplex-lattice"
Data Types: char | string
Experiment model, specified as one of the following values.
A character vector or string scalar with the model name.
Value Model Description "linear"(Default)The model contains an intercept and linear term for each factor. "constant"The model contains only a constant (intercept) term. "interactions"The model contains an intercept, a linear term for each factor, and all products of pairs of distinct factors (no squared terms). "purequadratic"The model contains an intercept term, and linear and squared terms for each factor. "quadratic"The model contains an intercept term, linear and squared terms for each factor, and all products of pairs of distinct factors. "scheffe-linear"The model contains a linear term for each factor and does not include an intercept term.
"scheffe-quad"The model is given by the formula:
"scheffe-special-cubic"The model is given by the formula:
"polyijk"The model is a polynomial with all terms up to degree iin the first factor, degreejin the second factor, and so on. Specify the maximum degree for each factor by using numerals 0 though 9. The model contains interaction terms, but the degree of each interaction term does not exceed the maximum value of the specified degrees. For example,"poly13"has an intercept and x1, x2, x22, x23, x1*x2, and x1*x22 terms, where x1 and x2 are the first and second factors, respectively.In the above table, each xi corresponds to the ith factor in the mixture design, and bi, bij, bijk, and dij are coefficients for the model terms.
A character vector or string scalar formula in Wilkinson notation. The factor names in the formula must be valid variable names specified by
FactorNames.A t-by-n terms matrix, where t is the number of terms and n is the number of factors in the design. A terms matrix is convenient when the number of factors is large and you want to generate the terms programmatically. For more information about terms matrices, see Terms Matrix.
ModelSpecification does not include the response variable
and does not affect the location of the design runs.
This argument sets the ModelSpecification
property.
Example: ModelSpecification="Factor1+Factor2*Factor3"
Example: ModelSpecification="scheffe-special-cubic"
Data Types: single | double | char | string
Properties
This property is read-only.
Degree of the design, specified as a positive integer.
Data Types: single | double
This property is read-only.
Generated design runs, represented as a table. Each column of
Design corresponds to a factor in the design, and each row
corresponds to a run.
This property is read-only.
Factor bounds, specified as a 2-by-n numeric matrix.
Data Types: double
This property is read-only.
Linear constraints, specified as a numeric matrix. When you specify
A and b,
LinearConstraints is [A,b].
Data Types: single | double
This property is read-only.
Algorithm for generating the design, specified as
"simplex-centroid", "simplex-lattice", or
"extreme-vertices".
Data Types: string
This property is read-only.
Experiment model, represented as a formula in Wilkinson notation. ModelSpecification indicates the
model you want to fit with the specified design. ModelSpecification
does not include the response variable.
Data Types: string
Object Functions
fitlm | Fit linear regression model using design runs |
Examples
Generate a mixture design for three factors.
dmix = mixtureDOE(3)
dmix =
mixtureDOE with properties:
Design: [7×3 table]
ModelSpecification: "Factor1 + Factor2 + Factor3"
Bounds: [2×3 double]
Degree: 3
Method: "simplex-centroid"
LinearConstraints: []
dmix is a mixtureDOE object that contains information about the generated mixture design. The output displays the degree of the design, the method used to generate the design runs, and the size of the tables describing the design and factors. The output also displays the model for the design, although the model does not affect how the software generates design runs.
Display the design table.
dmix.Design
ans=7×3 table
Factor1 Factor2 Factor3
_______ _______ _______
1 0 0
0 1 0
0 0 1
0.5 0.5 0
0.5 0 0.5
0 0.5 0.5
0.33333 0.33333 0.33333
The design table displays the values for the seven runs in the mixture design. The elements of each run sum to one.
Generate a mixture design and specify bounds for the design runs.
dmix = mixtureDOE([0.01 0.5 0.3; 0.1 0.6 0.7])
dmix =
mixtureDOE with properties:
Design: [5×3 table]
ModelSpecification: "Factor1 + Factor2 + Factor3"
Bounds: [2×3 double]
Degree: 0
Method: "extreme-vertices"
LinearConstraints: []
dmix is a mixtureDOE object that contains information about the generated mixture design. Because factor bounds are specified for the design, the function uses the "extreme-vertices" method to generate the design runs.
Generate some response data for the design runs.
rng(0,"twister") % For reproducibility runs = dmix.Design; h = height(runs); response = 2*runs.Factor1+3*runs.Factor2+runs.Factor3+0.01*randn(h,1);
Fit a linear model using the fitlm function. Specify the design runs in dmix as the predictor data and response as the response data.
mdl = fitlm(dmix,response)
mdl =
Linear regression model:
y ~ Factor1 + Factor2 + Factor3
Estimated Coefficients:
Estimate SE tStat pValue
________ ________ ______ _________
Factor1 2.0104 0.18533 10.848 0.0083916
Factor2 2.9234 0.071299 41.002 0.0005943
Factor3 1.1118 0.086745 12.817 0.0060326
Number of observations: 5, Error degrees of freedom: 2
Root Mean Squared Error: 0.0156
mdl is a LinearModel object that contains the results of fitting a linear model to the data. The model display includes the model formula, estimated coefficients, and model summary statistics.
Specify bounds and linear constraints for the design runs in a mixture experiment. The sum of the lower bounds for the design runs must be less than or equal to 1.
bounds = [0.1 0.1 0; 0.5 0.7 0.7]; A = [-0.85 -0.9 -1; 0.85 0.9 1; -0.7 0 -1]; b = [-0.9; 0.95; -0.4];
Generate design runs that satisfy the bounds and linear constraints.
dmix = mixtureDOE(bounds,A,b)
dmix =
mixtureDOE with properties:
Design: [7×3 table]
ModelSpecification: "Factor1 + Factor2 + Factor3"
Bounds: [2×3 double]
Degree: 0
Method: "extreme-vertices"
LinearConstraints: [3×4 double]
dmix is a mixtureDOE object that contains information about the generated mixture design. The design runs satisfy the following system of inequalities:
-0.85*Factor1-0.9*Factor2-Factor3 ≤ -0.9
0.85*Factor1+0.9*Factor2+Factor3 ≤ 0.95
-0.7*Factor1-Factor3 ≤ -0.4
Inspect the LinearConstraints property of dmix.
dmix.LinearConstraints
ans = 3×4
-0.8500 -0.9000 -1.0000 -0.9000
0.8500 0.9000 1.0000 0.9500
-0.7000 0 -1.0000 -0.4000
The first three columns of the matrix contain the left side of the system of inequalities. The last column contains the right side.
Generate a mixture design for an experiment that measures the effectiveness of different amounts of three ingredients in a drug. Specify the factor names, method for generating the design runs, and degree for the design.
dmix = mixtureDOE(3,FactorNames=["ingredient1","ingredient2","ingredient3"],Degree=10,Method="simplex-lattice")
dmix =
mixtureDOE with properties:
Design: [66×3 table]
ModelSpecification: "ingredient1 + ingredient2 + ingredient3"
Bounds: [2×3 double]
Degree: 10
Method: "simplex-lattice"
LinearConstraints: []
dmix is a mixtureDOE object that contains information about the generated mixture design. The output shows that the function generates the design runs using the simplex-lattice method, and the degree of the design is 10. Together with the method, the degree controls how many design runs are generated.
Display the design table.
dmix.Design
ans=66×3 table
ingredient1 ingredient2 ingredient3
___________ ___________ ___________
1 0 0
0.9 0.1 0
0.9 0 0.1
0.8 0.2 0
0.8 0.1 0.1
0.8 0 0.2
0.7 0.3 0
0.7 0.2 0.1
0.7 0.1 0.2
0.7 0 0.3
0.6 0.4 0
0.6 0.3 0.1
0.6 0.2 0.2
0.6 0.1 0.3
0.6 0 0.4
0.5 0.5 0
⋮
The design table displays the amount of each ingredient to be tested for the 66 design runs.
More About
A terms matrix
T is a t-by-n matrix specifying the
terms in a model, where t is the number of terms, and
n is the number of factors in the design. The value of
T(i,j) is the exponent of variable j in term
i.
For example, suppose that a design includes three factors x1,
x2, and x3. Each row of T
represents one term:
[0 0 0]— Constant term or intercept[0 1 0]—x2; equivalently,x1^0 * x2^1 * x3^0[1 0 1]—x1*x3[2 0 0]—x1^2[0 1 2]—x2*(x3^2)
References
[1] Cornell, J. A. Experiments with Mixtures: Designs, Models, and the Analysis of Mixture Data. United Kingdom: Wiley, 1990.
Version History
Introduced in R2024b
See Also
fullFactorialDOE | fractionalFactorialDOE | optimalDOE | taguchiDOE
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)