モンテカルロ シミュレーションの変数を使用したシミュレータの要因こんにちは、
データ テーブル (dt0) にリストされている複数のディメンションを使用してモンテカルロ シミュレーションを行うのが不思議です。dt0 の N 行は、ユーザーの入力と要件によって動的になります。
私の質問は、適切なルーチンを使用してそれらのディメンションを Simulator の Factors に追加する方法です。
「置換、解析」機能を使用して機能させようとしました。 ただし、これらすべてのディメンションが Factors() にリストされている場合にのみ機能します。
ここに私のスクリプトがあります:
Eval(
Substitute(
Expr(
myanalysis = dt << Profiler(
Y( :Name( "TA Target" ) ),
Profiler(
1,
Simulator(
1,
Factors( Dim A, Dim B, Dim C, Dim D, Dim E, Dim F, ),
Responses( Name( "TA Target" ) << No Noise ),
Resimulate
)
),
)
),
Expr( Dim A ), Parse( "Dim A<< Random( Normal( 1, 0.01 ) )" ),
Expr( Dim B ), Parse( "Dim B<< Random( Normal( 1, 0.01 ) )" ),
Expr( Dim C ), Parse( "Dim C<< Random( Normal( 1, 0.01 ) )" ),
Expr( Dim D ), Parse( "Dim D<< Random( Normal( 1, 0.01 ) )" ),
Expr( Dim E ), Parse( "Dim E<< Random( Normal( 1, 0.01 ) )" ),
Expr( Dim F ), Parse( "Dim F<< Random( Normal( 1, 0.01 ) )" ),
)
);Re: モンテカルロ シミュレーションの変数を使用したシミュレータの要因ありがとう、イアン!
おそらくこれは、関数リストに多くの変数を追加して、現在のバージョンの JMP に基づくスクリプトでモンテカルロ シミュレーションを取得する、最も有望で実行可能な方法です。
Re: モンテカルロ シミュレーションの変数を使用したシミュレータの要因はい、レポートを 2 回表示したのは、関数が機能することを説明するためだけでした。
上記のコーディング パターンに基づいて構築することができます ('SubstituteInto()' は任意の数の置換を行うことができます)。 生成された分析は意味がありませんが、以下のコードは例です。 「テンプレート式」は JMP によって作成されました (その後、いくつかの編集が行われました)。
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
// Define a JSL function
doSimulator =
function({x1Var, x2Var, yVar}, {Default Local},
// Template expression
myFit = Expr(
fm = dt << Fit Model(
Y( yTBD ),
Effects( x1TBD, x2TBD ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
Profiler(
1,
Simulator(
1,
Factors(
x1TBD << Random( Normal( 290, 50 ) ),
x2TBD << Random( Normal( 460, 50 ) )
),
Responses( yTBD << No Noise ),
Resimulate
)
)
)
)
);
// Bake in the variablee passed to the function
SubstituteInto(myFit,
Expr(x1TBD), NameExpr(x1Var),
Expr(x2TBD), NameExpr(x2Var),
Expr(yTBD), NameExpr(yVar)
);
// Do the fit
myFit;
// Return the reference to the fit Model object
fm;
);
// Try out the function . . .
f = doSimulator(Column(dt, "PNP1"), Column(dt, "PNP2"), Column(dt, "NPN1"));Re: モンテカルロ シミュレーションの変数を使用したシミュレータの要因どうもありがとう、イアン!
機能が働いているようです。 ただし、アドバイスに従ってスクリプトを使用すると、複数のプロファイラーが生成され、各プロファイラーに 1 つのファクターのみが表示されます。 すべてのファクターを 1 つの Profiler レポートに表示する方法を知りたいです。 何かコメントはありますか? 感謝します。
これが私の改訂されたスクリプトです:
doSimulator=Function(
{xVar, MeanVar, SigmaVar}, {Default Local},
myFP=Expr(
myProfiler=dt<<PROFILER></PROFILER>Re: モンテカルロ シミュレーションの変数を使用したシミュレータの要因おそらく、このコードは正しい方向を示しているかもしれません:
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Define a JSL function
doSimulator =
function({xVar, yVar}, {Default Local},
// Template expression
myFit = Expr(
fm = dt << Fit Model(
Y( yTBD ),
Effects( xTBD ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
Profiler(
1,
Simulator(
1,
Factors( xTBD << Random( Normal( 80, 10 ) ) ),
Responses( yTBD << No Noise ),
Resimulate
)
)
)
)
);
// Bake in the variablee passed to the function
SubstituteInto(myFit, Expr(xTBD), NameExpr(xVar), Expr(yTBD), NameExpr(yVar));
// Do the fit
myFit;
// Return the reference to the fit Model object
fm;
);
// Try out the function . . .
fhw = doSimulator(Column(dt, "height"), Column(dt, "weight"));
fwh = doSimulator(Column(dt, "weight"), Column(dt, "height"));