如何使用 JSL 通过修复预测分析器中的其他变量来找到满足规格限制的 X 变量范围?嗨,JSL 专家,
我有一个 DoE OLS 或 REML 模型,带有如下所示的预测分析器。如何通过修复其他变量,使用 JSL 自动找到所有满足 LSL 和 USL 的 X 变量范围?例如,X1 必须低于 34.6 才能满足规格。非常感谢您的帮助。

数据探索与可视化回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?JMP 17 介绍了设计空间分析器用于确定这种情况下的操作范围。 如果您还没有更新到 17,这是一个很好的理由。
如果您真的需要您描述的特定 JSL 解决方案,希望 JSL 技能比我高的人可以插话。
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?谢谢@Ross_Metusalem ,我们目前使用的是 JMP 16。 希望我们能尽快升级到 17。
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?同时,您可以使用Prediction Profiler 中的模拟功能以此目的。
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?@马克贝利你能给我一些提示,说明如何在预测刻画器中使用模拟来获取范围吗? 太感谢了。
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?您是否研究过我引用的帮助部分?
您必须首先指定响应限以确定意愿函数来评估因子范围的适用性。
在 Prediction Profiler 中打开模拟器。 所有因素水平在开始时都是固定的。 将 X1 更改为在过程控制下如您所期望的那样随机变化。 也指定响应的随机变化。 仿真将显示一个直方图,让您了解从 X1 到响应的误差传输的适用性。 模拟表将提供详细信息。
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?你好@马克贝利,我确实点击了你分享的链接,我可以手动找到每个 X 变量低于 5% 的缺陷率。 因为我有太多的模型和变量,所以我想找到一种方法来自动化这个过程,而不是一个一个地做。 这将花费很多时间。 可以在 JSL 中实现吗?
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?是的,您可以编写 Profiler 和它提供的模拟器的脚本。 请参阅帮助 > 脚本索引 > 对象 > 探查器和模拟器。

回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?@马克贝利我完成了参数的模拟,并且已经收集了所有的模拟结果。 超酷!!!非常感谢你的帮助。
对我来说唯一的挑战是从模型脚本中获取术语值。 我使用的是搜索“{Profiler(”然后搜索“Term Value”将所有术语放入列表中,然后模拟。 术语值有数字和字符,有的带有“xxxx”n,有的没有,很难针对所有不同的情况编写代码。 您是否有简单的方法从 DoE 模型中获取 Term 值?
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?经过 ” get the term value from the model script," 你是指模型表脚本中的参数估计吗? 您是否为模型保存了表格脚本?
字符串可以用作名称。 名称中不允许使用某些字符。 使用不正确的名称需要解决方法。
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?@马克贝利下面是我的例子之一。 我需要一个通用代码,它需要从 Fit 组模型中读取脚本,然后将 Term Value 放入因子列表中。 有了列表后,我将与数据表中的列名进行比较,以确定它们是数字还是字符,以便我可以编写我的模拟代码。最后一部分是我的代码,但是太复杂了,如果profiler里面有多个Term Value,就不行了。 所以最好只打开 Profiler。我想知道你是否有更简单的方法来完成同样的任务? 非常感谢你的帮助。
factors = {"ELONG", "HARDNESS(+/-0.2)", "ABRASION For example (%)", "MODULUS"}这是来自示例模型的脚本:
Fit Group(
Fit Model(
Y( :"SILICA (%)"n ),
Effects( :ELONG, :"HARDNESS(+/-0.2)"n ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
ELONG( 417.5, Lock( 0 ), Show( 1 ) ),
"HARDNESS(+/-0.2)"n( 69.775, Lock( 0 ), Show( 1 ) )
)
),
:"SILICA (%)"n << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Effect Tests( 0 ), Effect Details( 0 ),
Lack of Fit( 0 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 1 ), Plot Effect Leverage( 0 ),
Plot Residual by Normal Quantiles( 1 ), Box Cox Y Transformation( 0 ),
Press( 1 )}
)
),
Fit Model(
Y( :SILANE Value ),
Effects(
:"ABRASION For example (%)"n, :MODULUS, :ELONG, :"HARDNESS(+/-0.2)"n,
:MODULUS * :ELONG
),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
"ABRASION For example (%)"n( 133.1, Lock( 0 ), Show( 1 ) ),
MODULUS( 1255, Lock( 0 ), Show( 1 ) ),
ELONG( 417.5, Lock( 0 ), Show( 1 ) ),
"HARDNESS(+/-0.2)"n( 69.775, Lock( 0 ), Show( 1 ) )
)
),
:SILANE Value << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Effect Tests( 0 ), Effect Details( 0 ),
Lack of Fit( 0 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 1 ), Plot Effect Leverage( 0 ),
Plot Residual by Normal Quantiles( 1 ), Box Cox Y Transformation( 0 ),
Press( 1 )}
)
),
Fit Model(
Y( :SULFUR ),
Effects( :ELONG ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value( ELONG( 417.5, Lock( 0 ), Show( 1 ) ) )
),
:SULFUR << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Effect Tests( 0 ), Effect Details( 0 ),
Lack of Fit( 0 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 1 ), Plot Effect Leverage( 0 ),
Plot Residual by Normal Quantiles( 1 ), Box Cox Y Transformation( 0 ),
Press( 1 )}
)
),
<<{Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
<FONT color="#0000FF"> ELONG( 417.5, Lock( 0 ), Show( 1 ) ),
"HARDNESS(+/-0.2)"n( 69.775, Lock( 0 ), Show( 1 ) ),
"ABRASION For example (%)"n( 133.1, Lock( 0 ), Show( 1 ) ),
MODULUS( 1255, Lock( 0 ), Show( 1 ) )</FONT>
)
)}
);这是我制作因素列表的代码:
Names Default To Here( 1 );
dt = Current Data Table();
curep = Current Report();
dtname = dt << Get Name;
//Check how many prediction profiles, if >1 it's fit group, =1 it's fit model
pred_objs = curep << XPath( "//OutlineBox[ contains( text(), 'Prediction Profile' ) ]" );
num_objs = N Items( pred_objs );
If( num_objs < 1,
Throw( "No prediction profile is found!" )
);
If( num_objs == 1,
textind = "Profiler(",
textind = "{Profiler("
);
//Read the Model Term list
modelobj = curep[Outline Box( 1 )] << get scriptable object;
modeltext = Char( modelobj << get script );
//Show( modeltext );
posA = Contains( modeltext, textind );
termstext = Right( modeltext, Length( modeltext ) - posA + 1 );
/*Show( termstext );*/
posB = Contains( termstext, "Term Value" );
posC = Contains( termstext, "Show(1))", -1 );
termvalue = Left( termstext, posC + 7 ) || ","; //Make sure all terms end with )),
termvalue = Right( termvalue, Length( termvalue ) - posB - 10 );
/*Show( termvalue );
Show( posB );
Show( posC );
Show( posD );*/
//Check how many factors or main effects in the final model
words = Words( termvalue, "," );
termnum = 0;
For( i = 1, i <= N Items( words ), i++,
If( Contains( words[i], "Show" ),
termnum = termnum + 1
)
);
//Get the term with default value
term list = {};
For( k = 1, k <= termnum, k++,
//show(firstpos);
pos1 = Contains( termvalue, "))," ) + 3;
term1 = Left( termvalue, pos1 );
//show(term1);
termvalue = Right( termvalue, Length( termvalue ) - pos1 );
//show(termvalue);
Insert Into( term list, term1 );
);
Show( term list );
//get term name without default value
factors = {};
For( k = 1, k <= N Items( term list ), k++,
termK = term list[k];
firstchar = Left( termK, 1 );
If( firstchar == "\!"",
pos2 = Contains( termK, "\!"", -1 );
term2 = Left( termK, pos2 + 1 );
,
pos2 = Contains( termK, "(" ); //Categorical terms cannot have "()" in the column name
term2 = Left( termK, pos2 - 1 );
);
Insert Into( factors, char(parse(term2)) );
);
Show( factors );
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?我认为有一种更优雅、更健壮的方法。 有关我正在考虑的方法,请参阅此示例的结尾。
Names Default to Here( 1 );
// JMP Pro 16.2
// start with example of a model script
model = Expr(
Fit Group(
Fit Model(
Y( :"SILICA (%)"n ),
Effects( :ELONG, :"HARDNESS(+/-0.2)"n ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
ELONG( 417.5, Lock( 0 ), Show( 1 ) ),
"HARDNESS(+/-0.2)"n( 69.775, Lock( 0 ), Show( 1 ) )
)
),
:"SILICA (%)"n << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Effect Tests( 0 ), Effect Details( 0 ),
Lack of Fit( 0 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 1 ), Plot Effect Leverage( 0 ),
Plot Residual by Normal Quantiles( 1 ), Box Cox Y Transformation( 0 ),
Press( 1 )}
)
),
Fit Model(
Y( :SILANE Value ),
Effects(
:"ABRASION For example (%)"n, :MODULUS, :ELONG, :"HARDNESS(+/-0.2)"n,
:MODULUS * :ELONG
),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
"ABRASION For example (%)"n( 133.1, Lock( 0 ), Show( 1 ) ),
MODULUS( 1255, Lock( 0 ), Show( 1 ) ),
ELONG( 417.5, Lock( 0 ), Show( 1 ) ),
"HARDNESS(+/-0.2)"n( 69.775, Lock( 0 ), Show( 1 ) )
)
),
:SILANE Value << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Effect Tests( 0 ), Effect Details( 0 ),
Lack of Fit( 0 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 1 ), Plot Effect Leverage( 0 ),
Plot Residual by Normal Quantiles( 1 ), Box Cox Y Transformation( 0 ),
Press( 1 )}
)
),
Fit Model(
Y( :SULFUR ),
Effects( :ELONG ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value( ELONG( 417.5, Lock( 0 ), Show( 1 ) ) )
),
:SULFUR << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Effect Tests( 0 ), Effect Details( 0 ),
Lack of Fit( 0 ), Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Studentized Residuals( 1 ), Plot Effect Leverage( 0 ),
Plot Residual by Normal Quantiles( 1 ), Box Cox Y Transformation( 0 ),
Press( 1 )}
)
),
<<{Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
ELONG( 417.5, Lock( 0 ), Show( 1 ) ),
"HARDNESS(+/-0.2)"n( 69.775, Lock( 0 ), Show( 1 ) ),
"ABRASION For example (%)"n( 133.1, Lock( 0 ), Show( 1 ) ),
MODULUS( 1255, Lock( 0 ), Show( 1 ) )
)
)}
);
);
// last argument is in-line message send for Profiler
last = N Arg( model );
profilerExpr = Arg( model, last );
// unwrap Send() and its list argument
profilerExpr = Arg( profilerExpr, 1 )[1];
// find term values
termVals = Associative Array();
termExpr = Arg( profilerExpr, 3 );
nArgs = N Arg( termExpr );
For( i = 1, i <= nArgs, i++,
Insert Into( termVals,
Char( Head( Arg( termExpr, i ) ) ),
Arg( Arg( termExpr, i ), 1 )
)
);
// use resulting dictionary for term values
Show( termVals );回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规范限制?你最后显示的是你想要的变量值海峡是不是一个字符串。
你将如何使用海峡在你的脚本中? 它会成为函数的参数吗?
回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?@马克贝利str 只是一个变量名,在我下面的代码中我实际上使用了 random_sim 和 responses_sim,通过在我的 for 循环中改变这两个变量,我可以一次模拟所有因素。 我之前用来提取Y和Term Value的代码在字符串中有“\!,但是你提取参数的方式没有“\!,这是唯一的区别。
simu model script = Parse(
Eval Insert(
"\[
simobj << Simulator(
1,
Factors( ^random_sim^),
Responses( ^responses_sim^ ),
Resimulate
);
]\"
)
);
Show( simu model script );
Eval( simu model script );回复:如何使用 JSL 通过修复 Prediction Profiler 中的其他变量来找到 X 变量范围以满足规格限制?@马克贝利您的解决方案很棒,而且比我的容易得多。 非常感谢你的帮助。
但是我用这种方法遇到了另一个问题。 你能帮我吗?
factors = {"Kilometer (kg)"n, "Temperature (ºC)"n};
responses_sim = "";
values = {1.23,2.34};
for (i=1, i<=N Items(factors), i++,
responses_sim = responses_sim || factors[i] || "<< Add Random Noise(" || char(values[i]) || "),"
);
show(responses_sim);
responses_sim = "Kilometer (kg)<< Add Random Noise(1.23),Temperature (ºC)<< Add Random Noise(2.34),";
<BR /><FONT face="arial black,avant garde" size="5"><STRONG>I want to get this result below, how to do it?</STRONG></FONT>
responses_sim = "Kilometer (kg)"n << Add Random Noise(1.23), "Temperature (ºC)"n << Add Random Noise(2.34),"