Inference in Bayes Nets
Inference in a Bayesian Network is the process of reasoning under uncertainty - computing how beliefs about some variables should change when others are observed. The objective is to determine the posterior probability of one or more query variables given evidence variables , such that
where are hidden variables, and is a normalization constant.Exact inference computes this posterior without approximation and can be performed using several methods that differ mainly in efficiency.
- Inference by enumeration computes directly by expanding the full joint distribution defined by the network. We begin with the standard factorization formula for Bayes nets over all variables . We then marginalize out the hidden variables to keep only the query and the evidence :
after which we normalize to turn this joint into a conditional over :
Although conceptually straightforward, the number of terms grows exponentially with the number of hidden nodes.- Variable elimination produces the same , but it does not form in one giant step. Instead, it eliminates hidden variables one at a time. Let be a hidden variable to eliminate. Collect all current factors that mention ; call them . Form their product into a single joint factor over and its neighboring variables :