ジョンソン変換から定数を取得する方法みなさん、こんにちは。
私は、ジョンソン変換を使用して列を変換し、その式から定数を取得して逆式に戻して、それを使用して元の単位で仕様限界を計算できるスクリプトを開発しようとしていました。
ワークフローは次のようになります
列を選択 -> Johnson を使用して変換 -> 管理図を実行 -> 管理限界を確認してユーザー インターフェイスに入力 -> 仕様限界を元の単位で出力 -> 元の単位で管理図を再度実行し、前の手順で計算された値を入力します。
これのほとんどは処理できると思いますが、変換方程式から定数を取得する方法がわかりません。
ここから

ここに入れる

何かアイデアがあれば教えてください!
スティーブ
自動化とスクリプトRe: ジョンソン変換から定数を取得する方法数式を式に抽出し、そこから値を取得します。式を取得したら、たとえばArg()を使用して数式から値を取得できます。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
new_cols = dt << New Formula Column(
Operation(Category("Distributional"), "Johnson Normalizing"),
Columns(:weight)
);
new_col = Remove From(new_cols, 1)[1];
f_expr = Column(dt, new_col << get name) << Get Formula;
Show(Arg(f_expr, 1), Arg(f_expr, 2));
コミュニティにはこれに関する投稿がいくつかありますが、ここにJMP > JSL > 式の取得 > パラメータの抽出があります。
Re: ジョンソン変換から定数を取得する方法私がうまく使った方法の 1 つは、逐次近似を使用して、変換された分布の値に対する元の分布の値を見つけることです。基本的には、元の分布から値を取得し、変換分布から計算された値と一致するまで、変換式によって作成された式に渡します。次の例は、ジョンソン分布を当てはめ、変換された列の平均を見つけ、その変換平均値に対する元の分布の値を見つけます。この例では、変換された値をログに書き込むだけです。
Names Default To Here( 1 );
dt =
// Open Data Table: Semiconductor Capability.jmp
// → Data Table( "Semiconductor Capability" )
Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
theColumn = "NPN1";
Distribution(
Continuous Distribution(
Column( as column(theColumn) ),
Process Capability( Use Column Property Specs ),
Fit Johnson(save distribution formula)
),
SendToReport(
Dispatch( {"NPN1"}, "Process Capability", OutlineBox, {Close( 1 )} )
)
);
// Find the back transform of the calculated mean of the transformed distribution
theTargetCol = Column( dt, N Cols( dt ) ) << get name;
theFormula = Char( As Column( dt, theTargetCol ) << get formula );
theTarget = Col Mean( Column( dt, theTargetCol ) );
// Change the reference to the original column used in the transformation to _X_
// so it can be used in the back transform
Substitute Into( theFormula, ":"|| theColumn, "_X_" );
// The formula needs to create a memory variable to allow for comparison.
// Add the resulting variable name to be the resulting variable when the
// formula is executed
theFormula = "theResult = " || theFormula || ";";
// Successive Approximation will be used to get the back transform
// Use the min and max of the original column to start the approximations
theMax = Col Max(as column(theColumn) );
theMin = Col Min( as column(theColumn) );
// Loop through the approximations for up to 100 loops to find the value
For( i = 1, i <= 100, i++,
_X_ = Mean( theMax, theMin );
Eval( Parse( theFormula ) );
If(
theResult > theTarget, theMax = _X_,
theResult < theTarget, theMin = _X_,
Break()
);
);
// Display the findings in the log
Show( theTarget, theResult, _X_, i );Re: ジョンソン変換から定数を取得する方法@jthi さん、ありがとう!
次のように個々のパラメータを抽出するようにスクリプトを変更しました。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
new_cols = dt << New Formula Column(
Operation(Category("Distributional"), "Johnson Normalizing"),
Columns(:weight)
);
new_col = Remove From(new_cols, 1)[1];
f_expr = Column(dt, new_col << get name) << Get Formula;
test1=contains(char(arg(f_expr))," - (",1);
test2=contains(char(arg(f_expr)),"))",1);
c1=num(substr(char(arg(f_expr)),num(test1)+4,num(test2)-num(test1)-4));
test3=contains(char(arg(f_expr))," / ",1);
test4=contains(char(arg(f_expr)),") *",1);
c2=num(substr(char(arg(f_expr)),num(test3)+4,num(test4)-num(test3)-4));
test5=contains(char(arg(f_expr))," * ",1);
test6=contains(char(arg(f_expr)),"+",1);
c3=num(substr(char(arg(f_expr)),num(test5)+4,num(test6)-num(test5)-4));
c4=Arg(f_expr, 2);
Show(Arg(f_expr, 1), Arg(f_expr, 2));
今のところ順調に動作しています!
スティーブ
Re: ジョンソン変換から定数を取得する方法それは本当にクールですね翻訳者 !
これをもう少し試してみますが、これを使用して、変換された単位からターゲットを入力することができ (スクリプトが列の平均を使用する方法とは対照的)、元の単位で値が出力されるようです (これを正しく理解していれば)。
スティーブ
Re: ジョンソン変換から定数を取得する方法このような場合には、すべての式関数が非常に役立ちます。

N Arg(f_expr);
Head(f_expr);
Head Name(f_expr);
Head(Arg(f_expr, 1));
Head(Arg(Arg(f_expr, 1), 1));
場合によっては、Extract Exprをミックスに追加したい場合があります。
Extract Expr(f_expr, (:weight - Wild()));
Re: ジョンソン変換から定数を取得する方法それは正しいです、あるいは変換された分布から得られる他の統計は
Re: ジョンソン変換から定数を取得する方法こんにちは翻訳者 、
私はあなたのスクリプトを修正し(あまり恥ずかしがらないようにしてください笑)、仕様限界を入力して、それらの限界の変換された値を取得できるようにしました。これは素晴らしいことです。ただし、私のワークフローでは、実際には変換されたデータから仕様限界を入力して(変換されたデータで管理図を実行した後)、元のデータ値で出力できる必要があります。私はほとんどのコードに従いますが、自分でさらに変更しようとする自信が持てるほど十分ではありません。そのため、このコードで基本的に現在の動作を逆にするために、簡単に修正できるかどうか疑問に思っていました。
Names Default To Here( 1 );
dt=current data table();
theColumn = dt<<GET selected="" columns=""> theTarget_lcl, theMax = _X_,
theResult_lcl < theTarget_lcl, theMin = _X_,
Break()
);
);
// Display the findings in the log
Show( theTarget_lcl, theResult_lcl);
// Find the back transform of the calculated mean of the transformed distribution
theTargetCol = Column( dt, N Cols( dt ) ) << get name;
theFormula_ucl = Char( As Column( dt, theTargetCol ) << get formula );
theTarget_ucl = nebvalue2;
// Change the reference to the original column used in the transformation to _X_
// so it can be used in the back transform
Substitute Into( theFormula_ucl, ":"|| theColumn[1], "_X_" );
// The formula needs to create a memory variable to allow for comparison.
// Add the resulting variable name to be the resulting variable when the
// formula is executed
theFormula_ucl = "theResult_ucl = " || theFormula_ucl || ";";
// Successive Approximation will be used to get the back transform
// Use the min and max of the original column to start the approximations
theMax = Col Max(as column(theColumn) );
theMin = Col Min( as column(theColumn) );
// Loop through the approximations for up to 100 loops to find the value
For( i = 1, i <= 1000, i++,
_X_ = thetarget_ucl;
Eval( Parse( theFormula_ucl ) );
If(
theResult_ucl > theTarget_ucl, theMax = _X_,
theResult_ucl < theTarget_ucl, theMin = _X_,
Break()
);
);
// Display the findings in the log
Show( theTarget_ucl, theResult_ucl);
neb3<<SET></SET></GET>
<P>ご意見やご協力をいただければ幸いです。</P>
<BR />
<P>スティーブ</P>Re: ジョンソン変換から定数を取得する方法変更すべきでないステートメントの一部が変更されています。不適切な行をコメント アウトし、元に戻しました。また、管理図を実行して管理限界を取り除き、それを値として使用して元の分布に戻す機能も追加しました。
Names Default To Here( 1 );
dt=current data table();
theColumn = dt<<GET selected="" columns=""> theTarget_lcl, theMax = _X_,
theResult_lcl < theTarget_lcl, theMin = _X_,
Break()
);
);
neb1 << set( _X_ );
// Display the findings in the log
Show( i,_x_,theTarget_lcl, theResult_lcl);
// Find the back transform of the calculated mean of the transformed distribution
//theTargetCol = Column( dt, N Cols( dt ) ) << get name;
theFormula_ucl = Char( As Column( dt, theTargetCol ) << get formula );
//theTarget_ucl = nebvalue2;
// Change the reference to the original column used in the transformation to _X_
// so it can be used in the back transform
Substitute Into( theFormula_ucl, ":"|| theColumn[1], "_X_" );
// The formula needs to create a memory variable to allow for comparison.
// Add the resulting variable name to be the resulting variable when the
// formula is executed
theFormula_ucl = "theResult_ucl = " || theFormula_ucl || ";";
// Successive Approximation will be used to get the back transform
// Use the min and max of the original column to start the approximations
theMax = Col Max(as column(theColumn) );
theMin = Col Min( as column(theColumn) );
// Loop through the approximations for up to 100 loops to find the value
For( i = 1, i <= 15000, i++,
_X_ = Mean( theMax, theMin );
//_X_ = thetarget_ucl;
Eval( Parse( theFormula_ucl ) );
If(
theResult_ucl > theTarget_ucl, theMax = _X_,
theResult_ucl < theTarget_ucl, theMin = _X_,
Break()
);
);
// Display the findings in the log
Show( i,_x_,theTarget_ucl, theResult_ucl);
neb2 << set( _X_ );
neb3<<SET></SET></GET>
Re: ジョンソン変換から定数を取得する方法翻訳者ありがとう!
期待以上の対応をしていただき、ありがとうございます。素晴らしいです!
スティーブ