Hallo,
Ich muss täglich große Datendateien verwalten (10.000 Spalten x 20.000 Zeilen).
Mein Ziel ist es, mithilfe der Best-Fit-Methode (nur wenige Spalten sind normalverteilt) Fähigkeitsstatistiken aus allen Spalten mit Grenzwerten zu erhalten.
Ich habe ein schnelles und schmutziges Skript erstellt, das:
- Spalten mit Grenzen durchlaufen,
- Plotverteilung > „fits all“ > Fähigkeit,
- wählt die Informationen im Berichtsfenster aus und
- Schließen Sie das Berichtsfenster
Der Code „scheint“ zu funktionieren, aber wenn ich die Metriken einzeln zeichne, um zu überprüfen, ob die neue Tabelle mit den Informationen übereinstimmt, unterscheiden sich die Ergebnisse manchmal (nicht der gleiche Verteilungstyp, nicht die gleichen Ppk/Cpk-Werte). Andererseits sind USL, LSL und N immer richtig (das Skript wählt also die Informationen aus dem rechten Fenster aus).
Ich weiß nicht, woher das Problem kommt:
– Ich habe einige Wait()-Befehle hinzugefügt, um sicherzustellen, dass der Prozessor aufholen kann, bevor eine neue Schleife gestartet wird (aber reicht das aus? Ist es der richtige Weg?)
- Liegt es daran, dass die JMP-Fits-All-Funktion nicht so präzise ist, wie ich erwartet habe?
- Ist es etwas anderes?
Ich habe ein Skript angehängt, das eine Tabelle mit 15.000 Zeilen und Zufallsformeln generiert, gefolgt vom eigentlichen Code.
In diesem Beispiel sollte der erste erste SHASH sein, in der Tabelle wird jedoch Johnson Sl gemeldet (mit unterschiedlicher Fähigkeit). die 2x anderen sind ähnlich.
Vielen Dank für deine Hilfe 
Prediger
//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;
);Ich konnte das Problem reproduzieren. Ich habe es auf ein Problem eingegrenzt, bei dem „Fit Distribution( „All“)“ im Verteilungsbefehl angegeben wurde. Es scheint, dass die Verschiebung der „Fit-Verteilung“ in einen separaten Aufruf die Diskrepanz behebt.
dis = dt << Distribution(
Continuous Distribution( Column( As Column( MetricCols[i] ) )/*, Fit Distribution( "All" ), Process Capability( 0 )*/, invisible )
);
dis << Fit All;
Ich schlage vor, dass Sie dieses Problem an die Support-Gruppe bei JMP weiterleiten
Danke Jim,
Tatsächlich funktioniert die Lösung und zeigt nun die richtige Anpassung in der neuen Tabelle an.
Ich werde mit der JMP-Supportgruppe kommunizieren.
Gibt es in JSL eine intelligente Möglichkeit, die Prozessfähigkeit für die beste Anpassung von diesem Punkt an zu generieren? (Damit ich die neue Tabelle mit Cpk, Cpu ... füllen kann)
Ich könnte mir einen schmutzigen Weg vorstellen, dies zu tun (die Passform finden, den Bericht schließen, den Bericht mit der Fähigkeit der richtigen Passform erneut öffnen), aber wenn es einen intelligenteren Weg gibt, würde ich es vorziehen.
Ich habe ein paar Variationen des folgenden Codes ausprobiert, er funktioniert nicht und ich konnte weder im Skriptindex noch in den Diskussionen etwas finden.
Dank im Voraus,
Prediger
dis = dt << Distribution(
Continuous Distribution( Column( As Column( MetricCols[i] ) ),/*, Fit Distribution( "All" ),*/ Process Capability( 0 ), invisible )
);
dis << Fit All;
dis << Process Capability ("Lognormal");