Open takesei opened 3 years ago
tagupy.design.generator
experience matrix
exmatrix
result matrix
resmatrix
Simulator
tagupy.simulator
Multinominal
Class Multinominal
tagupy.type._Simulator
_Simulator.__init__(self, **kwargs: Dict[str,Any])
kwargs
_Simulator.simulate(self, exmatrix:np.ndarray) -> np.ndarray
Multinominal.__init__(self, n_factor: int, n_out: int, max_dim : int)
coef_table
n_out
n_factor
max_dim
Multinominal.simulate(self, exmatrix: np.ndarray) -> np.ndarray
n_experience
c_nは, それぞれn番目のcoefficietを表す. x_iはそれぞれの要素の数値を表す
図1なようなcoefテーブルとなったとき, 各のoutput, y1, y2は同じ行に存在する値の数字を参照しながら以下のように与えられる
もし今回, x1 = 10, x2 = 5, x3 = 10 が与えられたとした場合,
このとき, exmatrixの行情報はそれぞれの要員をどれくらい入れるかの情報のため, 行ごとにみた時に [In] exmatrixの一行: 要員の値 → [Out] retmatrixの一行: y1, y2の値 となる
忘れてました, 誤差項(Normal(x | 0, σ^2))いれてください, 追記しますね
multinominalではなくてmultinomialでした, 修正します
Overview
tagupy.design.generator
パッケージで作成された計画行列(experience matrix
,exmatrix
) を元に, 仮想的な実験結果(result matrix
,resmatrix
)を出力するモジュール,Simulator
を作成したいtagupy.simulator
中に多項式モデルを提供するクラス,Multinominal
を作成するDescription
Class Multinominal
の継承元tagupy.type._Simulator
を継承する._Simulator.__init__(self, **kwargs: Dict[str,Any])
...kwargs
はシミュレータの設定を書く_Simulator.simulate(self, exmatrix:np.ndarray) -> np.ndarray
...exmatrix
は計画行列Class Multinominal
のロジックClass Multinominal
で作成するメソッドは二つであり, 抽象クラスのメソッド二つのoverloadだけであるMultinominal.__init__(self, n_factor: int, n_out: int, max_dim : int)
coef_table
の作成及びインスタンス変数として格納(図1)coef_table
は(n_out
xn_factor
)のnp.ndarrayn_factor
,n_out
,max_dim
らをインスタンス変数として格納Multinominal.simulate(self, exmatrix: np.ndarray) -> np.ndarray
exmatrix
(n_experience
xn_factor
)の情報を用いて仮想データの生成を行うn_experience
xn_out
)であるFigure
図1coef: np.ndarrayの例 (n_factor=3, n_out=2, max_dim=2)
c_nは, それぞれn番目のcoefficietを表す. x_iはそれぞれの要素の数値を表す
資料2 データ生成のアルゴリズム
図1なようなcoefテーブルとなったとき, 各のoutput, y1, y2は同じ行に存在する値の数字を参照しながら以下のように与えられる
もし今回, x1 = 10, x2 = 5, x3 = 10 が与えられたとした場合,