This script illustrates an approach for three components, X1, X2, X3, and the quadratic Scheffe model.
Names Default to Here( 1 );
// make design
doe = DOE(
Custom Design,
{Add Response( Maximize, "Y", ., ., . ), Add Factor( Mixture, 0, 1, "X1", 0 ),
Add Factor( Mixture, 0, 1, "X2", 0 ), Add Factor( Mixture, 0, 1, "X3", 0 ),
Set Random Seed( 27513 ), Number of Starts( 10000 ), Add Term( {1, 1} ),
Add Term( {2, 1} ), Add Term( {3, 1} ), Add Term( {1, 1}, {2, 1} ),
Add Term( {1, 1}, {3, 1} ), Add Term( {2, 1}, {3, 1} ), Set Sample Size( 12 ),
Simulate Responses( 0 ), Save X Matrix( 1 ), Make Design,
Set Run Order( Randomize )}
);
// make design data table
doe dt = doe << Make Table;
doe << Close Window;
// get model matrix, X
model matrix expr = doe dt << Get Script( "Model Matrix" );
X = Arg( Arg( model matrix expr, 1 ), 2 );
inv x prime x = Inverse( X` * X );
// make expression for prediction variance
pv expr = Substitute(
Expr(
xi = Matrix( List( :X1, :X2, :X3, :X1*:X2, :X1*:X3, :X2*:X3 ) );
xi` * iii * xi;
),
Expr( iii ), inv x prime x
);
// add data column with prediction variance formula
Eval(
Substitute(
Expr(
doe dt << New Column( "Prediction Variance", Numeric, Continuous,
Formula( fff )
);
),
Expr( fff ), Name Expr( pv expr )
)
);
// plot prediction variance
mp = doe dt << Mixture Profiler(
Y( :Prediction Variance ),
Mixture Profiler(
1,
Term Value(
X1( 0.333333333333335, Lock( 0 ), Show( 1 ) ),
X2( 0.333333333333336, Lock( 0 ), Show( 1 ) ),
X3( 0.333333333333335, Lock( 0 ), Show( 1 ) )
),
Contour Value(
Prediction Variance(
0.5,
Min( 0 ),
Max( 1 )
)
),
Top Factor( X1 ),
Left Factor( X2 ),
Right Factor( X3 )
)
);
mp << Contour Grid( 0, 1, 0.1, :Prediction Variance );