選択したデータの非線形曲線をフィッティングします。データ テーブルからデータ列を直接使用するのではなく、ユーザーが選択した列を使用するようにしたいと考えました。 しかし、値は数式に渡されません。
Y_axis = colListY << Get Items;
X_axis = colListX << Get Items;
Group_by = colListBy << Get Items;
New Column( "Model",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
Parameter(
{p = 0.29, x0 = 15, m0 = 1.2, x1 = 30, m1 = 5},
p * (1 - Exp( -(:X_axis / x0) ^ m0 )) + (1 - p) * (1
-Exp( -(:X_axis / x1) ^ m1 ))
)
),
);
nlin = dt << Nonlinear(
SendToByGroup( Bygroup Default ),
Y( :Y_axis ),
X( :Model ),
Iteration Limit( 1000 ),
Unthreaded( 1 ),
QuasiNewton BFGS,
Finish,
By(:Group_By )<BR /> );
基本的なデータ分析とモデリングウィンドウズRe: 選択したデータの非線形曲線のフィッティング。異なるプラットフォームを使用するには、データテーブルにデータが必要です。 次を使用してユーザー選択を構築できます。新しい窓() 。
Re: 選択したデータの非線形曲線のフィッティング。新しいウィンドウを作成し、ユーザーがこれらの列リスト ボックスを使用して必要なフィールドを選択できるようにしました。 ただし、データテーブルからのみ列を取得するため、これらの値を非線形関数に渡す方法。
Button box("X Column", colListX<<APPEND></APPEND>

Re: 選択したデータの非線形曲線のフィッティング。ヴィヌーシャ
カスタム ユーザー ダイアログの完全なスクリプトがないため、問題の原因を推測しています。 ColListBox からの入力を取得して使用する方法だと思います。 以下は、JSL アプリケーション本用に書かれたスクリプトの抜粋です。 ColListBox の結果は、列参照ではなく、列名、テキストのリストです。
_init = {_yusr={}, _xusr={}, _gusr={}};
EvalList(_init);
//define expressions, actions
_src_get = Expr( _src << Get Selected );
//dialog
ccol_dlg = New Window("Custom Column Dialog", <<MODAL></MODAL>
X 変数の列の性別を指定します。 このスクリプトを実行し、ログ ウィンドウの出力を確認します。
show(_yusr, _xusr, _gusr);
/*:
_yusr = {"weight", "height"};
_xusr = {"sex"};
_gusr = {"age"};
スクリプトの新しい列式と NLN には列参照が必要です。 それがジャーモがあなたに言っていたことだと思います。
//:*/
show(Column(_gusr[1]))
/*:
Column(_gusr[1]) = Column("age");
_gusr[1] は列名 "age" であり、列を参照するには Column("age) であり、次と同等の Column(_gusr[1]) を使用します。 :年。
Re: 選択したデータの非線形曲線のフィッティング。@ヴィヌシャ、 @jthi 、
バージョン 16 と 17 では JMP をあまり使用していません。 前のスクリプトは JMP 13 用に作成されました。 それ以来、JMP/JSL はユーザー ウィンドウ内の変数を列形式で保持します。 したがって、スクリプトはより単純になります。 Col_dlg の出力を参照してください。
bc_dt = Open( "$SAMPLE_DATA/Big Class.JMP" );
//Below is JSL to build the basic dialog using the Column Dialog function.
col_dlg = Column Dialog(
_yVar = ColList( "Y, Response",, Data Type(Numeric), MinCol (1) ),
_xVar = ColList( "X, Treatment", Data Type(Character), MinCol(1), MaxCol(1) ),
_grpVar = ColList( "Group Factors", Data Type(Any) ),
);
Show( col_dlg, col_dlg["_yVar"], col_dlg["_xVar"],
col_dlg["_grpVar"], col_dlg["Button"] );
If (col_dlg["Button"] == -1, Throw( "User Cancel") );
Remove From( col_dlg , N Items(col_dlg) ); //Remove the last item
Eval List ( col_dlg );
Show( col_dlg, _yVar, _xVar, _grpVar );
これが出力です
Show( col_dlg, _yVar, _xVar, _grpVar );
/*:
col_dlg = {_yVar = {:height, :weight}, _xVar = {:sex}, _grpVar = {:age}, Button(1)};
col_dlg["_yVar"] = {:height, :weight};
col_dlg["_xVar"] = {:sex};
col_dlg["_grpVar"] = {:age};
col_dlg["Button"] = 1;
col_dlg = {_yVar = {:height, :weight}, _xVar = {:sex}, _grpVar = {:age}};
_yVar = {:height, :weight};
_xVar = {:sex};
_grpVar = {:age};
したがって、列を _yVar[1] などとして参照できます。
Re: 選択したデータの非線形曲線のフィッティング。(通常は) Eval() を使用できます
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Nonlinear Examples/US Population.jmp");
nw = New Window("User Selections", << Modal, << Return Result,
H List Box(
Panel Box("Column Selections",
window:fcs = Filter Col Selector(dt)
),
Panel Box("User Selections",
Lineup Box(N Col(2),
Button Box("X", << Set Function(Function({this},
(this << sib) << Set Items((window:fcs << Get Selected));
))),
clb_x = Col List Box(dt, Min Items(1), Max Items(1), N Lines(2)),
Button Box("Y", << Set Function(Function({this},
(this << sib) << Set Items((window:fcs << Get Selected));
))),
clb_y = Col List Box(dt, Min Items(1), Max Items(1), N Lines(2)),
Button Box("By", << Set Function(Function({this},
(this << sib) << Set Items((window:fcs << Get Selected));
))),
clb_by = Col List Box(dt, Max Items(1), N Lines(2)),
)
),
Panel Box("Actions",
Lineup Box(N Col(1),
Button Box("OK",
x_selection = clb_x << get items;
y_selection = clb_x << get items;
by_selection = clb_x << get items;
),
Button Box("Cancel"),
)
)
)
);
obj = Nonlinear(
Y(Eval(y_selection)),
X(Eval(x_selection)),
Finish()
);Re: 選択したデータの非線形曲線のフィッティング。同じことを実行しましたが、エラーが発生し、データテーブルにも値の代わりに列名が表示されます。
Names Default To Here( 1 );
Error = expr(New Window("JMP ALERT" , <<MODAL></MODAL>Re: 選択したデータの非線形曲線のフィッティング。数式の場合、選択した列をそこで評価する必要がある場合があります。 この投稿はそのためのアイデアを提供しますEval Insert、Eval Expr、Parse、Substitute を使用して、ある式を別の式に挿入する
Re: 選択したデータの非線形曲線のフィッティング。この場合、なぜ Exp と Eval を使用する必要があるのでしょうか。ユーザーからの入力を取得しているので、この方程式でそれらを使用できるでしょうか。
x_selection = colListX << get items;
y_selection = colListY << get items;
by_selection = colListBy << get items;
New Column( "Model",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
Parameter(
{p = 0.29, x0 = 15, m0 = 1.2, x1 = 30, m1 = 5},
p * (1 - Exp( -(Eval(x_selection)/ x0) ^ m0 )) + (1 - p) * (1
-Exp( -Eval(x_selection)/ x1) ^ m1 )
)
),
);