mixtureDOE
Description
A mixtureDOE
object contains a design for a mixture experiment.
The elements of a point 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. The object properties include information about the design, model, and
algorithm used to generate the design.
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 points. 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 points.dmix
= mixtureDOE(___,Name=Value
)
Input Arguments
n
— Number of factors
positive integer
Number of factors in the design, specified as a positive integer.
Data Types: single
| double
bounds
— Factor bounds
2-by-n matrix
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.
Example: [0.1 0.1 0; 0.5 0.7 0.7]
Data Types: single
| double
A
— Linear inequality constraints
m-by-n numeric matrix
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 points:
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
.
Example: A=[0.3 5 100; 0.1 7 90; 0.25 2 180]
Data Types: single
| double
b
— Linear inequality constraints
numeric vector with m elements
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 points:
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
.
Example: b=[1 5 2]
Data Types: single
| double
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
— Degree of design
positive integer
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 points. The possible values for
Degree
depend on the value of Method
.
Method | Values for Degree | Number of Design Points |
---|---|---|
"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 points. 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.
Example: Degree=5
Data Types: single
| double
FactorNames
— Factor names
string vector | cell array of character vectors
Factor names, specified as a string vector or a cell array of character vectors.
Example: FactorNames=["compound1","compound2"]
Data Types: char
| string
| cell
Method
— Algorithm for generating design
"simplex-centroid"
| "simplex-lattice"
| "extreme-vertices"
Algorithm for generating the mixture design, specified as one of the following values.
Value | Description |
---|---|
"simplex-centroid" | This method generates design points that contain elements equal to 0, 1, or a fraction. The fraction elements of a point 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 points
|
"simplex-lattice" | This method generates design points that contain elements equal to 0, 1, or a fraction. The fraction elements of a point have denominators less than or equal to the number of factors in the model. For example, a design with three factors includes the points
|
"extreme-vertices" | This method uses the shape of the design space to generate points 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 points 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
,Method
can 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 forMethod
depends 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 —
Method
can be any value listed in the table above, and the default value is"simplex-centroid"
.Implied lower bound —
Method
must be"extreme-vertices"
.
The default value for Method
is
"simplex-centroid"
when you specify n
, and
"extreme-vertices"
when you specify A
and
b
.
Example: Method="simplex-lattice"
Data Types: char
| string
ModelSpecification
— Experiment model
string scalar | character vector | t-by-p terms matrix
Experiment model, specified as one of the following values.
A character vector or string scalar with the model name.
Value Model Description "linear"
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, 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:
"poly
ijk
"The model is a polynomial with all terms up to degree i
in the first factor, degreej
in 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 factor 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 points.
Example: ModelSpecification="Factor1+Factor2*Factor3"
Example: ModelSpecification="scheffe-special-cubic"
Data Types: single
| double
| char
| string
Properties
Degree
— Degree of design
positive integer
This property is read-only.
Degree of the design, specified as a positive integer. This property is set by the
Degree
name-value argument when you create the
mixtureDOE
object.
Data Types: single
| double
Design
— Generated design points
table
This property is read-only.
Generated design points, specified as a table. Each column of
Design
corresponds to a factor in the design, and each row
corresponds to a point.
Data Types: table
Bounds
— Factor bounds
2-by-n numeric matrix
This property is read-only.
Factor bounds, specified as a 2-by-n numeric matrix. This
property is set by the bounds
input argument when you create the
mixtureDOE
object.
Data Types: double
LinearConstraints
— Linear constraints
numeric matrix
This property is read-only.
Linear constraints, specified as a numeric matrix.
This property is set by the A
and b
input
arguments when you create the mixtureDOE
object. When you specify
A
and b
,
LinearConstraints
is [A,b]
.
Data Types: single
| double
Method
— Algorithm for generating design
"simplex-centroid"
| "simplex-lattice"
| "extreme-vertices"
This property is read-only.
Algorithm for generating the design, specified as
"simplex-centroid"
, "simplex-lattice"
, or
"extreme-vertices"
. This property is set by the
Method
name-value argument when you create the
mixtureDOE
object.
Data Types: string
ModelSpecification
— Experiment model
formula in Wilkinson notation
This property is read-only.
Experiment model, specified 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.
This property is set by the ModelSpecification
name-value argument when
you create the mixtureDOE
object.
Data Types: string
Object Functions
fitlm | Fit linear regression model using design points |
Examples
Generate Mixture Design
Generate a mixture design for three factors.
dmix = mixtureDOE(3)
dmix = mixtureDOE with properties: Design: [7x3 table] ModelSpecification: "Factor1 + Factor2 + Factor3" Bounds: [2x3 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 points, 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 points.
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 points in the mixture design. The elements of each point sum to one.
Specify Factor Bounds and Fit Linear Model
Generate a mixture design and specify bounds for the design points.
dmix = mixtureDOE([0.01 0.5 0.3; 0.1 0.6 0.7])
dmix = mixtureDOE with properties: Design: [5x3 table] ModelSpecification: "Factor1 + Factor2 + Factor3" Bounds: [2x3 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 points.
Generate some response data for the design points.
rng(0,"twister") % For reproducibility pts = dmix.Design; h = height(pts); response = 2*pts.Factor1+3*pts.Factor2+pts.Factor3+0.01*randn(h,1);
Fit a linear model using the fitlm
function. Specify the design points 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 Linear Constraints
Specify bounds and linear constraints for the design points in a mixture experiment. The sum of the lower bounds for the design points 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 points that satisfy the bounds and linear constraints.
dmix = mixtureDOE(bounds,A,b)
dmix = mixtureDOE with properties: Design: [7x3 table] ModelSpecification: "Factor1 + Factor2 + Factor3" Bounds: [2x3 double] Degree: 0 Method: "extreme-vertices" LinearConstraints: [3x4 double]
dmix
is a mixtureDOE
object that contains information about the generated mixture design. The design points 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.
Specify Factor Names, Method, and Degree of Design
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 points, and degree for the design.
dmix = mixtureDOE(3,FactorNames=["ingredient1","ingredient2","ingredient3"],Degree=10,Method="simplex-lattice")
dmix = mixtureDOE with properties: Design: [66x3 table] ModelSpecification: "ingredient1 + ingredient2 + ingredient3" Bounds: [2x3 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 points using the simplex-lattice method, and the degree of the design is 10. Together with the method, the degree controls how many design points 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 points.
More About
Terms Matrix
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)
Wilkinson Notation
Wilkinson notation describes the terms in a model. The notation relates to the terms included in the model, not to the multipliers (coefficients) of those terms.
Wilkinson notation uses these symbols:
+
means include the next variable.–
means do not include the next variable.:
defines an interaction, which is a product of the terms.*
defines an interaction and all lower order terms.^
raises the predictor to a power, exactly as in*
repeated, so^
includes lower order terms as well.()
groups the terms.
This table shows typical examples of Wilkinson notation.
Wilkinson Notation | Terms in Standard Notation |
---|---|
1 | Constant (intercept) term |
x1^k , where k is a positive
integer | x1 ,
x12 , ...,
x1k |
x1 + x2 | x1 , x2 |
x1*x2 | x1 , x2 ,
x1*x2 |
x1:x2 | x1*x2 only |
–x2 | Do not include x2 |
x1*x2 + x3 | x1 , x2 , x3 ,
x1*x2 |
x1 + x2 + x3 + x1:x2 | x1 , x2 , x3 ,
x1*x2 |
x1*x2*x3 – x1:x2:x3 | x1 , x2 , x3 ,
x1*x2 , x1*x3 ,
x2*x3 |
x1*(x2 + x3) | x1 , x2 , x3 ,
x1*x2 , x1*x3 |
For more details, see Wilkinson Notation.
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
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)