同じスクリプトを使用して劣化モデルを異なるデータに適合させることができるように、劣化スクリプトを自動化しようとしています。
現在、Fit Modelを使用して、必要なモデルをデータに適合させることができ、パラメーターを列行列として取得しています。
次に、分解モデルの初期値に行列を入力しようとしましたが、すべてのパラメーターを変更せずにモデルを出力するだけです。 以下のスクリプトの初期値であるパラメーター値として、分解スクリプトに行列を入力する方法はありますか?
Degradation(
Y( :"Output/mV"n ),
Time( :Time in hours ),
Label( :Unit ID ),
Application( Repeated Measures Degradation ),
Connect Data Markers( 1 ),
Show Fitted Lines( 1 ),
Show Spec Limits( 1 ),
Show Median Curves( 0 ),
Show Legend( 0 ),
No Tab List( 0 ),
Set Upper Spec Limit( . ),
Set Lower Spec Limit( . ),
Set Censoring Time( . ),
Show Residual Plot( 1 ),
Show Inverse Prediction Plot( 1 ),
Inverse Prediction Interval( No Interval ),
Inverse Prediction Alpha( 0.05 ),
Path Specifications(
Nonlinear Path(
Add Formula(
Formula Name( "Model" ),
Formula(
Parameter(
{a = 200, b = -0.00007},
a[Unit ID] * Exp( b[Unit ID] * Time in hours )
),
),<BR />//Trying to enter my matrix of parameters into the model
Initial Values(A_para),
Fitting Method( QuasiNewton BFGS ),
),
Select Formula( "Model" )
),
Run Model( "Model" )
),
Nonlinear Path( 1 ),
Mean Path( 1 ),
SendToReport(
Dispatch(
{"Overlay", "Output/mV Residuals by Time in hours"},
"7",
ScaleBox,
{Min( -80 ), Max( 210 ), Inc( 50 ), Minor Ticks( 4 )}
),
Dispatch(
{"Overlay", "Output/mV Residuals by Time in hours"},
"13",
ScaleBox,
{Min( -80 ), Max( 210 ), Inc( 50 ), Minor Ticks( 4 )}
),
Dispatch(
{"Overlay", "Model Specification"},
"Empty",
TextEditBox,
{Fixed Size( 1, 100, 19 ), Set Text( "Model" )}
),
)
);obj = Fit Curve(
Y( :"Output/mV"n ),
X( :Time in hours ),
Group( :Unit ID ),
);
//Currently this is using a slighlty different fitting method to the one used by the degredation platform
obj << Fit Exponential 2P;
//Next I want to create the table of parameter estimates
dt_p = obj << (Fit[1] << Make Parameter Table);
//Now create a single column matrix of the parameter estimates
col_scale = Column( dt_p, "Scale" );
col_growth = Column( dt_p, "Growth Rate" );
A_scale = col_scale << Get As Matrix;
A_growth = col_growth << Get As Matrix;
A_para = A_scale |/ A_growth;
//Put values into a column to check I've done it right
dt_temp = Data Table( "Stacked and Transposed New Dates Raw Data" );
col_p = dt_temp << New Column( "Parameters" );
col_p << Set Values(A_para);
現時点では、劣化プラットフォームは、希望する方法でマトリックスの名前付き変数を取得できません。
回避策は、式を作成してから評価することです。
すでに行列があるとします
A_para = [....];
これは初期値を保持します。
回避策は、次のような式を作成することです。
code = expr(Degradation(
Initial Values(
A_para
),
Fixed(
....
)
));
次に、次のように、名前A_paraを実際のマトリックスに置き換えます。
substitute into(code, expr(A_para), A_para);
最後に、次の方法でコードを実行します。
eval(code);
入力した初期値をそのまま使いたいのなら、Fixed節に自分の行列を割り当てる必要があると思います。
どうなるか教えてください。