こんにちは、
ビッグ データ ファイル (10,000 列 x 20,000 行) を毎日管理する必要があります。
私の目標は、最適な方法 (少数の列のみが正規分布する) を使用して、制限付きのすべての列から能力統計を取得することです。
私は次のような簡単で汚いスクリプトを作成しました。
- 制限のある列をループします。
- プロット分布 > "すべてに適合" > 能力、
- レポートウィンドウ内の情報を選択し、
- レポートウィンドウを閉じます
コードは機能しているように見えますが、新しいテーブルが情報と一致するかどうかを確認するためにメトリクスを個別にプロットすると、結果が異なる場合があります (分布タイプが同じではなく、Ppk/Cpk 値も同じではありません)。一方、USL、LSL、および N は常に正しいです (したがって、スクリプトは右側のウィンドウから情報を選択します)。
問題の原因がわかりません:
- 新しいループを開始する前にプロセッサが確実に追いつくことができるように、いくつかの Wait() コマンドを追加しました (しかし、これで十分ですか? 正しい方法ですか?)
- JMP のすべてに適合する機能が期待したほど正確ではないためですか?
- それは別のことですか?
15,000 行とランダムな数式を含むテーブルを生成するスクリプトと、その後に実際のコードを添付しました。
この例では、最初の 1 つ目は SHASH である必要がありますが、テーブル内で Johnson Sl が報告されます (異なる機能を使用)。他の 2 つも同様です。
ご協力ありがとうございました 
説教者
//Create table with random distribution
dt = New Table( "tabletest",
Add Rows( 15000 ),
New Column( "Normal 10,1", Numeric, "Continuous", formula( Random Normal( 10, 1 ) ) ),
New Column( "LogNormal 10,1", Numeric, "Continuous", formula( Random Lognormal( 10, 1 ) ) ),
New Column( "Gamma 10,1", Numeric, "Continuous", formula( Random Gamma( 10, 1 ) ) ),
New Column( "Normal 10,2", Numeric, "Continuous", formula( Random Normal( 10, 2 ) ) );
);
Column( dt, "Normal 10,1" ) << set property( "spec limits", {LSL( 6 ), USL( 14 ), Show Limits( 0 )} );
Column( dt, "LogNormal 10,1" ) << set property( "spec limits", {LSL( 0 ), USL( 400000 ), Show Limits( 0 )} );
Column( dt, "Gamma 10,1" ) << set property( "spec limits", {LSL( 0 ), USL( 40 ), Show Limits( 0 )} );
dt << save( "$Desktop\tabletest.jmp" );
//Get Column only with limits (At east LSL or USL, I don't care about target)
MetricCols = dt << Get Column Names( numeric, continuous );
Show( MetricCols );
For( i = N Items( MetricCols ), i >= 1, i--,
Q = Column( MetricCols[i] ) << Get Property( "Spec limits" );
Show( Q );
spec_x = Eval List( {Arg( Q, 1 )/*, Arg( Q, 2 ), Arg( Q, 3 )*/} );
Show( spec_x );
If( N Row( Loc( spec_x, Empty() ) ),
Remove From( MetricCols, i )
);
);
//Create a new table to collect the stats from the "Test" table
CpkTable = New Table( "Capability Best Fit",
Add Rows( N Items( MetricCols ) ),
New Column( "Metric", "Character", "Nominal" ),
New Column( "N", "Numeric", "Continuous" ),
New Column( "LSL", "Numeric", "Continuous" ),
New Column( "USL", "Numeric", "Continuous" ),
New Column( "Best Fit", "Character", "Nominal" ),
New Column( "Cpk", "Numeric", "Continuous" ),
New Column( "Cpl", "Numeric", "Continuous" ),
New Column( "Cpu", "Numeric", "Continuous" )
);
//Loop to run Distribution > Fit ALL > Capability and collect the stats
For( i = 1, i <= N Items( MetricCols ), i++,
Show( i );
dt = Open( "$Desktop\tabletest.jmp" );
dis = dt << Distribution(
Continuous Distribution( Column( As Column( MetricCols[i] ) ), Fit Distribution( "All" ), Process Capability( 0 ), invisible )
);
Wait( 0 );
// Point to the first capability analysis and create a data table from it
dtCpk = dis << report;
Wait( 0 );
// Fill USL and LSL in the new table
Limits = Column( MetricCols[i] ) << Get Property( "Spec limits" );
Try( CpkTable:LSL[i] = Limits["LSL"] );
Try( CpkTable:USL[i] = Limits["USL"] );
// Find N and fill the new table
Try(
FindN = dtCpk["Summary Statistics"][Number Col Box( 1 )] << get;
CpkTable:N[i] = FindN[6];
);
// find the best fit and fill the new table
Try(
var = dtCpk["Compare Distributions"][String Col Box( "Distribution" )] << get;
CpkTable:Best Fit[i] = var[1];
CpkTable:Metric[i] = Char( MetricCols[i] );
);
// get CPK parameters from best fit capability analysis and fill the new table
Try(
cpk = dtCpk["Fitted " || var[1]]["Quantile Sigma"][Number Col Box( "Index" )] << get;
CpkTable:Cpk[i] = cpk[2];
CpkTable:Cpl[i] = cpk[4];
CpkTable:Cpu[i] = cpk[5];
Show( MetricCols[i] );
Show( var[1] );
Show( cpk );
);
Wait( 0 );
dtCpk << close window;
);問題を再現することができました。私は、Distribution コマンド内で指定されている「Fit Distribution( "All" )」の問題に原因を絞り込みました。 「フィット分布」を別の呼び出しに移動すると、不一致が修正されるようです。
dis = dt << Distribution(
Continuous Distribution( Column( As Column( MetricCols[i] ) )/*, Fit Distribution( "All" ), Process Capability( 0 )*/, invisible )
);
dis << Fit All;
この問題を JMP のサポート グループに報告することをお勧めします。
ありがとう、ジム
実際、ソリューションは機能し、新しいテーブルに適切な値が表示されるようになりました。
JMPサポートグループと連絡を取ります。
JSL には、その時点から最適なプロセス能力を生成する賢い方法はありますか? (新しいテーブルに Cpk、Cpu を設定できます...)
汚い方法 (適合を見つけてレポートを閉じ、適切な適合からの機能でレポートを再度開く) を考えることもできますが、よりスマートな方法があるのであれば、私はそれを好みます。
以下のコードのいくつかのバリエーションを試してみましたが、機能せず、スクリプトインデックスやディスカッションにも何も見つかりませんでした。
前もって感謝します、
説教者
dis = dt << Distribution(
Continuous Distribution( Column( As Column( MetricCols[i] ) ),/*, Fit Distribution( "All" ),*/ Process Capability( 0 ), invisible )
);
dis << Fit All;
dis << Process Capability ("Lognormal");