Lecture 11.1: Probabilistic Reasoning and Bayesian Networks
An in-depth guide to Bayesian reasoning, conditional and joint probability updates, and Bayesian Network inference.
In real-world settings, agents must act under uncertainty. Since classical logic cannot easily handle noisy or incomplete information, we rely on probability theory to model belief.
Bayesian reasoning provides a mathematically rigorous way to update an agent's beliefs (represented as probabilities) when new evidence or observations arrive, moving from initial intuition to disciplined reasoning.
Foundations of Conditional Probability
To understand Bayes' rule, we first build from basic probability concepts.
Mutually Exclusive Events
Two events and are mutually exclusive if they cannot occur at the same time (e.g., throwing a single die and getting both a and a simultaneously). The probability of either event occurring is the sum of their individual probabilities:
Dependent Events & Joint Probability
When events are not independent, the occurrence of one event alters the likelihood of another. The joint probability represents the probability that both and occur:
Because joint probability is commutative (), we can derive Conditional Probability (the probability of occurring given that has already occurred):
Bayes' Theorem (Bayes' Rule)
Named after Reverend Thomas Bayes, this fundamental theorem describes how to update the probability of a hypothesis () based on observing new evidence ():
Where:
- (Posterior Probability): The updated probability of hypothesis after observing evidence .
- (Likelihood): The probability of observing evidence given that hypothesis is true.
- (Prior Probability): The initial probability of the hypothesis before seeing the evidence.
- (Marginal Likelihood / Evidence): The total probability of the evidence under all possible hypotheses. If we only have two mutually exclusive outcomes ( and ), it is calculated as:
Thus, the full expanded form is:
Generalizing Bayes' Rule: Multiple Hypotheses & Evidence
In complex diagnostic settings, we often choose among multiple mutually exclusive and exhaustive hypotheses given multiple independent evidences .
Assuming the evidences are conditionally independent given each hypothesis, the generalized posterior probability is:
Step-by-Step Simulation: Updating Beliefs with Incoming Evidence
Let's walk through a concrete numerical example. Suppose a system has three possible hypotheses () and can observe three pieces of evidence ().
Prior and Conditional Probabilities Table:
| Probabilities | Hypothesis | Hypothesis | Hypothesis |
|---|---|---|---|
| Prior | |||
We will observe evidences one by one and update our beliefs dynamically.
Step 1: Observing Evidence
When is observed, we compute the updated probability for each hypothesis.
-
Denominator (Marginal Likelihood ):
-
Updated Posteriors :
Belief Shift: After observing , the belief in decreases slightly (from to ), while the belief in increases (from to ). and are now tied.
Step 2: Observing Evidence (in addition to )
Now we receive and update the beliefs using joint evidence :
-
Denominator :
-
Updated Posteriors :
Belief Shift: is now considered the most likely hypothesis by far (), and belief in has dropped dramatically down to .
Step 3: Observing Evidence (in addition to )
Finally, we observe and update to :
-
Denominator :
- Note that . Thus, cannot produce evidence .
-
Updated Posteriors :
Belief Shift: Because , hypothesis is completely abandoned (). emerges as the most likely hypothesis (), followed closely by ().
Bayesian Networks
A Bayesian Network is a graphical model that represents probabilistic dependencies among a set of random variables. It consists of:
- Structure (DAG): A Directed Acyclic Graph where:
- Nodes: Represent random variables (discrete or continuous).
- Edges: Directed arrows pointing from parent to child, representing direct influence or causal dependency. Cycles are forbidden to avoid infinite probability calculation loops.
- Parameters (CPTs): Each node has an associated Conditional Probability Table (CPT) that quantifies the effects of its parent nodes. If a node has no parents (root node), its CPT reduces to its prior probability distribution.
Reasoning and Inference in Bayesian Networks
Once the network structure and CPTs are defined, we can perform inference—calculating posterior probabilities of target query variables given some observed variables (evidence).
1. Exact Inference Algorithms
Calculate the exact mathematical posterior distribution:
- Variable Elimination: Evaluates the joint distribution sum by distributing sums over products, avoiding redundant computations.
- Junction Tree Algorithm: Transforms the DAG into a tree of cliques (clique tree) and uses belief propagation messaging to calculate exact margins.
2. Approximate Inference Algorithms
For highly complex networks with hundreds of variables, exact inference is NP-hard. We use randomized sampling:
- Direct Sampling: Generates samples starting from root nodes down using prior distributions.
- Rejection Sampling: Generates direct samples but discards (rejects) any sample that does not match the observed evidence.
- Likelihood Weighting: Keeps all samples but weights each one by the likelihood of the observed evidence, avoiding the sample waste of rejection sampling.
- Markov Chain Monte Carlo (MCMC) & Gibbs Sampling: Generates samples by making state transitions in a Markov chain whose stationary distribution matches the network's joint probability distribution.
3. Deterministic Approximations
- Mean Field Variational Methods: Formulates inference as an optimization problem, approximating the true posterior with a simpler, factorized distribution.
- Expectation Propagation: Iteratively updates local approximations of factorized distributions.
Influence Diagrams: Extending Bayes Networks for Decision Making
While Bayesian networks model probabilistic dependencies (diagnosis and prediction), Influence Diagrams extend them to model choice and value. They introduce two new types of nodes:
- Decision Nodes (Rectangles): Represent actions or choices that the agent can actively choose to perform.
- Utility Nodes (Diamonds): Quantify the desirability, reward, or value associated with different outcomes.
By combining probability, choice, and utility, influence diagrams serve as a complete framework for making optimal decisions under uncertainty.
Lecture 11.1: Population-Based Approaches and Swarm Intelligence
Exploring Genetic Algorithms, Ant Colony Optimization (ACO), and Particle Swarm Optimization (PSO).
Lecture 11.2: Markov Chains and Hidden Markov Models
A comprehensive analysis of Markov Chains, state properties, stationary distributions, and Hidden Markov Models (HMM).