안녕하세요,
저는 매일 대용량 데이터 파일을 관리해야 합니다(10,000열 x 20,000행).
제 목표는 최적 적합 방법을 사용하여 한계가 있는 모든 열에서 기능 통계를 얻는 것입니다(몇 개의 열만 정규 분포를 갖습니다).
저는 다음과 같은 간단하고 간단한 스크립트를 만들었습니다.
- 제한이 있는 열을 반복합니다.
- 플롯 분포 > "모두에 적합" > 기능,
- 보고서 창에서 정보를 선택합니다.
- 보고서 창을 닫습니다
코드는 "작동하는" 것처럼 보이지만, 새 표가 정보와 일치하는지 확인하기 위해 개별적으로 메트릭을 플로팅하면 때때로 결과가 다릅니다(분포 유형이 같지 않고 Ppk/Cpk 값이 같지 않음). 반면 USL, LSL 및 N은 항상 옳습니다(따라서 스크립트가 올바른 창에서 정보를 선택합니다)
문제가 어디서 오는지 모르겠습니다.
- 프로세서가 새 루프를 시작하기 전에 따라잡을 수 있도록 Wait() 명령을 추가했습니다(하지만 충분할까요? 올바른 방법일까요?)
- JMP Fits all 기능이 내가 기대했던 만큼 정확하지 않기 때문인가요?
- 다른 것인가요?
15,000개의 행과 무작위 수식을 포함하는 표를 생성하는 스크립트와 실제 코드를 첨부했습니다.
이 예에서 첫 번째 첫 번째는 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;
);고맙습니다 짐,
실제로 솔루션은 작동하여 이제 새 표에 딱 맞는 결과가 표시됩니다.
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");저는 문제를 재현할 수 있었습니다. 저는 문제를 Distribution 명령 내에서 "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 지원 그룹에 제출하는 것이 좋습니다.