如何使用 JSL 透過修復 Prediction Profiler 中的其他變數來尋找 X 變數範圍以滿足規格限制?JSL 專家您好,
我有一個帶有預測刻畫器的 DoE OLS 或 REML 模型,如下所示。如何透過修復其他變量,使用 JSL 自動找到所有 X 變量範圍以滿足 LSL 和 USL?例如,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),"