# 貝氏網路 (Bayesian Network)

(1)
\begin{align} P(x_1, ..., x_n) = \prod_{i=1}^{n} P(x_i | parent(X_i)) \end{align}

# 以蒙地卡羅馬可夫算法 (Markov Chain Monte Carlo) 計算貝氏網路的聯合機率分布

Algorithm MCMC-Ask(X,e,bn, N) returns an estimate of P(X|e)
local variables : N[X], a vector of counts over X, initially zero
Z, the nonevidence variables in bn
x, the current state of the network, initially copied from e.
initialize x with random values for the variable for the variables in Z
for j=1 to N do
N[x] = N[x] + 1 where x is the value of X in x
for each Zi in Z do
sample the value of Zi in x from P(Zi | mb(Zi)) given the value of MB(Zi) in X
return Normalize(N[X])


# 參考文獻

1. 網路電子書 , Handbook of Computational Statistics, J.E. Gentle et. al. ISBN-10: 3540404643
2. Persi Diaconis, The Markov Chain Monte Carlo Revolution
3. Stuart Russell and Peter Norvig, Artificial Intelligence: A Modern Approach (Second Edition)