Command Palette
Search for a command to run...
マルコフ連鎖モンテカルロ法 MCMC
日付
メトロポリス・ヘイスティングスのサンプリング
1: マルコフ連鎖の初期状態を初期化する $latex {X\mathop{{}}\nolimits_{{0}}\text{ }=\text{ }x\mathop{{}}\nolimits_{{0}}} $
2: $latex の以下の処理をサンプルします。 {t\text{ }=\text{ }0,\text{ }1,\text{ }2,\text{ }…}$
- $latex {t}$ 時点でのマルコフ連鎖の状態は $latex {X\mathop{{}}\nolimits_{{t}}\text{ }=\text{ }x\mathop{{}}\nolimits_{ {t }}}$、サンプリング $latex {y\text{ } \sim \text{ }q{ \left( {x \left| x\mathop{{}}\nolimits_{{t}}\right. } \右) }}$
- 一様分布からの $latex のサンプリング {u\text{ } \sim \text{ }Uniform{ \left[ {0,1} \right] }}$
- If $latex {u\text{ } < \text{ } \alpha { \left( {x\mathop{{}}\nolimits_{{t}},y} \right) }\text{ }=\text{ } min{ \left\{ {\frac{{p{ \left( {y} \right) }q{ \left( {x\mathop{{}}\nolimits_{{t}} \left| y\right. } \right) }}}{{p{ \left( {x\mathop{{}}\nolimits_{{t}}} \right) }p{ \left( {y \left| x\mathop{{} }\nolimits_{{t}}\right. } \right) }}},1} \right\} }}$ は転送を受け入れます $latex {x\mathop{{}}\nolimits_{{t}}\text{ } \to \text{ }y}$、つまり $latex {X\mathop{{}}\nolimits_{{t+1}}\text{ }=\text{ }y}$
- それ以外の場合、転送は受け入れられません。つまり、$latex {X\mathop{{}}\nolimits_{{t+1}}\text{ }=\text{ }x\mathop{{}}\nolimits_{{ t}}}$
ギブスサンプリング
1: $latex {X\mathop{{}}\nolimits_{{0}}\text{ }=\text{ }x\mathop{{}}\nolimits_{{0}},\text{ }Y\ をランダムに初期化しますmathop{{}}\nolimits_{{0}}\text{ }=\text{ }y\mathop{{}}\nolimits_{{0}}}$
2: $latex の循環サンプリング {t\text{ }=\text{ }0,\text{ }1,\text{ }2,\text{ }…}$
- $latex {y\mathop{{}}\nolimits_{{t+1}}\text{ } \sim \text{ }p{ \left( {y \left| x\mathop{{}}\nolimits_{{t }}\右。 } \右) }}$
- $latex {x\mathop{{}}\nolimits_{{t+1}}\text{ } \sim \text{ }p{ \left( {x \left| y\mathop{{}}\nolimits_{{t +1}}\right. } \right) }}$