Implemented in MATLAB.
OBSV indicates the observation for evidence variables e.
The function eliminate(x, e, obsv, bn) returns the probability distribution of variable x, given evidence variables and their observation [e, obsv], and a Bayesian network bn.
n1 ~ n5 are the nodes in the Bayesian network
pb_jm is a probability table on variables (1, 4, 5), respectively.