안녕하세요,
매일(10,000열 x 20,000행) 빅데이터 파일을 관리해야 합니다.
내 목표는 최적합 방법(몇 개의 열만 정규 분포됨)을 사용하여 제한이 있는 모든 열에서 공정 능력 통계를 얻는 것입니다.
나는 다음과 같은 빠르고 더러운 스크립트를 만들었습니다.
- 제한이 있는 열을 반복합니다.
- 플롯 분포 > "모두 적합" > 기능,
- 보고서 창에서 정보를 선택하고
- 보고서 창을 닫습니다.
코드는 작동하는 것처럼 보이지만 새 테이블이 정보와 일치하는지 확인하기 위해 측정항목을 개별적으로 구성할 때 결과가 때때로 다릅니다(동일한 분포 유형이 아니고 동일한 Ppk/Cpk 값이 아님). 반면에 USL, LSL 및 N은 항상 옳습니다(그래서 스크립트는 오른쪽 창에서 정보를 선택합니다).
문제가 어디서 발생하는지 모르겠습니다.
- 새 루프를 시작하기 전에 프로세서가 따라잡을 수 있는지 확인하기 위해 몇 가지 Wait() 명령을 추가했습니다(하지만 충분합니까? 올바른 방법입니까?)
- JMP Fits all 기능이 생각보다 정확하지 않아서 그런 걸까요?
- 뭔가 다른 건가요?
15,000개의 행과 임의의 수식이 포함된 테이블을 생성하는 스크립트와 실제 코드를 첨부했습니다.
이 예에서 첫 번째는 SHASH여야 하지만 테이블에 Johnson Sl이 보고됩니다(다른 기능 포함). 2x 다른 것은 비슷합니다.
많은 도움을 주셔서 감사합니다 
설교자
//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;
);문제를 재현할 수 있었습니다. 분포 명령 내에서 "Fit Distribution( "All" )"이 지정되는 문제로 범위를 좁혔습니다. "Fit Distribution"을 별도의 호출로 이동하면 불일치가 해결되는 것으로 보입니다.
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");