Now, for the inference algorithm. Please skip this if you do not intend to know the gory details of JavaBayes.
The core inference engine in JavaBayes handles arbitrary Bayesian networks. Consider a set x of discrete variables with a finite number of values. A Bayesian network defines a probability distribution through the expression:
whereInferences with Bayesian networks usually involve the calculation of posterior marginals for a particular set of variables, a problem which is called belief assessment or belief updating. Another standard problem is the calculation of expectations for a utility function u(x):
Ep[u|e] = sumx not in e ue(x) p(x|e),
where p(x|e) indicates the joint distribution conditioned on the evidence. A particular case is u(x) = xq, in which case the posterior expectation for u(x) is the posterior expected value for the queried variable xq.Maximization of probabilities and expectations are respectively called the maximum a posteriori hypothesis problem (called MAP) and the maximum expected utility problem (called MEU) MAP and MEU problems seek to obtain:
The MAP problem is obtained when u(x) = 1:
JavaBayes is centered upon a general algorithm for probabilistic inference, variously called bucket elimination [2] or variable elimination [7]. All the standard problems mentioned above are solved through a generalized version of bucket elimination.
The algorithms are derived for the general case where a set of variables x is under consideration, where x is actually a subset of the full set of variables. It is assumed that x does not overlap with the evidence. When marginals or expectations involve a single variable xq, we can take x = xq without any modifications in the algorithms.
The basic algorithm in JavaBayes is adapted from Zhang and Poole [7], but is extended to handle maximizations and expectations in the uniform manner suggested by Dechter [2].
Three preliminary steps are necessary. The first step is to incorporate the evidence e into the network. Every probability distribution and utility function is restricted to a domain that contains no evidence. For example, evidence x2 = 3 transforms a distribution p(x1, x2, x3) into pe(x1, x3) = p(x1, x2 = 3, x3).
Second, select an ordering for the set x, equal to x1, ... , xn Call yi the ith variable in this ordering. Two types of restrictions must be respected by this ordering. If the objective is to solve a MAP or MEU problem, then the decision variables must come last. If not, then the variables in x must come last.
Third, construct a set of functions F containing all probability distributions in the network. If a utility function u(x) is specified, then include u(x) into F.
The idea of the algorithm is to multiply the members of F in the sequence given by the ordering. In doing so we construct the expression for the Bayesian network; the key fact about the algorithm is that it attempts to eliminate variables as soon as possible so that the resulting products are always manageable. Variables are eliminated by summation or maximization depending on the problem.
For all yi such that yi is not in x or e, repeat the following.
To sum yi out from a function b(), evaluate
bi(Yi) = sumyi bi(yi, Yi). To maximize yi out from a
function bi(yi, Yi), evaluate bi(Yi) =
There are several cases to consider after the buckets are processed.
The variable ordering used in the algorithm is arbitrary (except for the conditions imposed above), but different orderings lead to different computational loads. A minimum deficiency heuristic search is known to produce efficient orderings in practice [5], but this is not implemented yet in JavaBayes.
© Fabio Cozman[Send Mail?] Sat Aug 9 21:32:23 EDT 1997