你好,
我想创建一个脚本,其中基于一些先前的输入变量, DOE[] 对象被发送消息以使用一个额外的因素。
DOE 设计生成现在运行起来很繁重(大约 30 秒),所以我正在寻找一种精简的方式(例如,在发送“制作设计”消息之前对其进行调整)。
理想情况下,我想使用 if 子句,检查所述布尔变量是否为真,如果是,则将该因子添加到自定义设计中。
一些“伪代码”:
AddSpecialFactor = 1; /* decision rule to add factor, will be retrieved from a modal window based on some more complex molecule chemistry input */
D = DOE(
custom design,
Add Factor(continuous, "A",.....),
Add Factor( ...),
..
If (AddSpecialFactor = 1) then Add Factor(....),
Add Term(),
..
If (AddSpecialFactor = 1) then Add Term() ...,
非常欢迎所有建议
这对于设计一代来说是一个很酷的想法。
我正致力于从 CSV 中获取设计并生成 DOE。 https://community.jmp.com/t5/Byron-Wingerd-s-Blog/Automating-Design-Generation/ba-p/407039
让您的脚本概念生成一个数据表,然后使用上面博客中的脚本来加载和运行 DOE 平台可能会起作用。
也许得到一个列名列表,如果该列表包含某些单词,那么添加具有适当因子级别的列?
谢谢拜伦,
从表中加载是一个好主意。
虽然我必须调整模型,因为它作为 RSM 更复杂:它具有分支因素,如 Peter Goos 和 Bradley Jones 的出版物:
Goos 和 Jones (2019) 存在嵌套因子的最优实验设计。 技术计量学。
https://doi.org/10.1080/00401706.2018.1562986
您是否还有代码以文本格式构建然后用于评估()表达式的示例。
喜欢:
DOECODE = "Part of the code " || if(..,) || etc...
.
.
DOEcommand = evaluate(DOECODE);
DOETable = (DOEcommand << Make Table);
下面是一个示例,说明如何编写此过程的脚本。
Names Default to Here( 1 );
dialog = New Window( "Optional Factor", << Modal,
Outline Box( "Choice",
Text Box( "Add X4?" ),
Text Box( "Click OK to add" ),
Text Box( "Click Cancel to skip" )
),
H List Box(
Button Box( "OK" ),
Button Box( "Cancel" )
)
);
doe = DOE( Custom Design,
{Add Response( Maximize, "Y", ., ., . ),
Add Factor( Continuous, -1, 1, "X1", 0 ),
Add Factor( Continuous, -1, 1, "X2", 0 ),
Add Factor( Continuous, -1, 1, "X3", 0 ), Set Random Seed( 30650037 ),
Add Term( {1, 0} ), 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( 0 )}
);
// add 4th factor and the associated main effect and interaction terms
If( dialog["Button"] == 1,
doe
<< Add Factor( Continuous, -1, 1, "X4", 0 )
<< Add Term( {4, 1} )
<< Add Term( {1, 1}, {4, 1} )
<< Add Term( {2, 1}, {4, 1} )
<< Add Term( {3, 1}, {4, 1} )
);