Ich stecke fest, wie ich die Ableitung der Spline-Anpassung nehmen soll. So wie ich es geschrieben habe, ist es direkt aus der Formel gezogen, aber ich möchte es robuster machen. Wie kann ich dies codieren, um die Ableitung der Spline-Prädiktorspalte zu nehmen?
CWfunc = Function({dt_current}, {default local},
//Dieser Teil der Funktion erstellt die bahnübergreifende Einheitlichkeitsprüfung//
dt_sub = dt_aktuell;
zeigen (dt_sub);
dt_sub << Select Where(:Panel_RS == "Loop Qual Panel 2");
dt_sub2 = dt_sub << Teilmenge(
Zeilen auswählen (1),
nur ausgewählte Spalten ( 0 ),
);
zeigen (dt_sub2);
dt_sub3 = dt_sub2 << Zusammenfassung(
Gruppe( :Crossweb_LQ, :Loop Lot_LQ ),
Mittelwert( :"Steigung(195-250)"n ),
Freq( "Keine" ),
Gewicht ("Keine"),
Link zur ursprünglichen Datentabelle ( 0 )
);
dt_sub3:"Crossweb_LQ"n << Datentyp setzen("Numerisch");
dt_sub3:"Crossweb_LQ"n << Set Modeling Type("Continuous");
dt_sub4 = dt_sub3 << Bivariat(
Y( :"Mittelwert(Steigung(195-250))"n ),
X( :Crossweb_LQ ),
Von( :Loop Lot_LQ ),
Keil anpassen (100),
//Vorhersagen speichern
);
splinecol = dt_sub4 << (Kurve[1] << Vorhersagen speichern);
return(dt_aktuell,dt_sub,dt_sub2,dt_sub3);
);
Derfunc = Function({dt_sub3}, {default local},
dt_sub3 << Neue Spalte("Derivat",
Numerisch,
"kontinuierlich",
Format( "Beste", 12 ),
Formel
Num Deriv(Spline Eval(
:Crossweb_LQ,
[1 2.20042178298482 0.057778359275709 0 -0.000683765776914872,
5 2,38777421036511 0,02495760198378 -0,00820518932298666 0,000416694078291779,
9 2,38299001014311 -0,0206825968420827 -0,00320486038348031 0,000748030601767463,
13 2,29685581515222 -0,0104160110250642 0,00577150683773822
-0.0000755519945723868,
17 2,34270055280314 0,0321295479373521 0,00486488290286867 -0,000773631610584581,
21 2,49954444792103 0,0339142938522158 -0,00441869642415559
-0.0000691115769849535,
25 2,56007933961637 -0,00475263323630778 -0,00524803534797586
0.0000699348227685678,
29 2,46157606976071 -0,0433800445272273 -0,00440881747475221
-0.000380207536072129,
33 2,19318152974715 -0,09690054605672 -0,00897130790762231
-0.0000379484318864192,
37 1,65960971935758 -0,170492534048238 -0,0094266890902598 0,00104740989891671,
40 1.09157198267128 0 0 0]
)
);
);
dt_sub3 << Neue Spalte("Pass/Fail",
Charakter,
Nominal,
);
Rückgabe (dt_aktuell, dt_sub, dt_sub2, dt_sub3);
);
Slopefunc = Function({dt_current}, {default local};
dt_sum = dt_current << Zusammenfassung(
Group( :"Panel Dose (ug/dL)_RS"n, :Loop Lot_LQ, :Foil_LQ ),
Mittelwert (: CW-korrigierter AR ),
Freq( "Keine" ),
Gewicht( "Keine" )
);
zeigen (dt_summe);
dt_graph = dt_sum < Y( :"Mittelwert(CW-korrigierter AR)"n ),
X( :"Paneldosis (ug/dL)_RS"n ),
Von( :Loop Lot_LQ ),
Gruppieren nach ( :Foil_LQ ),
);
show(dt_graph);
dt_graph << Anpassungslinie;
return(dt_graph);
);
mainfunc = Function({dt_current}, {Default Local},
Ausgang1 = CWfunc(dt_current);
Ausgang2 = DerFunc(Ausgang1[4]);
Ausgang3 = Slopefunc (dt_current);
);