Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.38 KB

README.md

File metadata and controls

31 lines (22 loc) · 1.38 KB

Gibbs-Sampling

Method of approximation for variable elimination implemented in python

$$ \begin{align} P(A | B = b^{1}) &= \frac{1}{Z}\sum_{DC}(\Phi_1(A,B) \Phi_2(B,C) \Phi_3(C, D) \Phi_4(D,A))_{B = b^1} (Obs\,B = b^{1})\\ &= \frac{1}{Z}\sum_{DC}((\Phi_1(A) \Phi_2(C) \Phi_3(C, D) \Phi_4(D,A))_{B = b^1}(Elimination\, Order\, = C,D)\\ &= \frac{1}{Z}(\Phi_1(A) \sum_{D} \Phi_4(D,A)\sum_{C}\Phi_3(C,D) \Phi_2(C))(Sum\, out\, C)\\ &= \frac{1}{Z}(\Phi_1(A) \sum_{D} \Phi_4(D,A)\Phi_5(D))(Sum\,out\, D)\\ &= \frac{1}{Z}(\Phi_1(A) \Phi_6(A))\\ &\approx \end{align} $$

image

We show the process of the resulting factor tables:

image

image

Gibbs sampling procedure:

Randomly choosing A,C or D then sampling based on the posterior distribution of their Markov blanket. The convergence of the sampling procedure is shown in the figure below. The red line represents the value gained from variable elimination for $P(A = a1|B = b1)$

Figure_1