Lecture 11.1: Probabilistic Reasoning and Bayesian Networks
An in-depth guide to Bayesian reasoning, conditional and joint probability updates, law of total probability, 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:
In rule-based expert systems, this relationship is expressed as:
Foundations of Conditional & Joint Probability
To understand Bayes' rule, we first build from basic counting principles and probability concepts.
Classical Probability & Dice Roll Model
Consider a single throw of a standard 6-sided die where obtaining a is defined as the only successful event.
- Let be the number of successful outcomes ().
- Let be the number of failure outcomes ().
The probability of success and probability of failure are:
Since success and failure partition the outcome space, their sum equals unity:
Mutually Exclusive vs. Dependent Events
- Mutually Exclusive Events: Two events and are mutually exclusive if they cannot occur simultaneously in a single trial (e.g., obtaining both a and a on a single die throw). The probability of either event occurring is:
- Dependent Events: When events are not independent, the occurrence of one event alters the likelihood of another occurring.
Conditional & Joint Probability Derivation
From a counting perspective, the conditional probability of event occurring given that event has already occurred is defined as:
In standard set and logic notation, the joint probability (or ) represents the probability that both and occur:
Because joint probability is commutative (), we can equate both expressions:
Rearranging yields the core definition of Conditional Probability:
Law of Total Probability & Sample Space Partitioning
When an event depends on a set of mutually exclusive and exhaustive events , the joint probability for each partition is:
Summing across all partitions yields the Law of Total Probability:
Binary Sample Space Partition ( and )
If event depends on only two mutually exclusive events ( and its complement ), the total probabilities of and expand as:
Bayes' Theorem (Bayes' Rule)
Named after Reverend Thomas Bayes, Bayes' Theorem describes how to update the probability of a hypothesis () given observed evidence ():
By substituting the binary Law of Total Probability for , we obtain the expanded form:
Terminology Breakdown:
- (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 hypothesis before observing evidence.
- (Complementary Prior): The prior probability of hypothesis being false ().
- (Likelihood under Complement): The probability of finding evidence even when hypothesis is false (false positive rate).
- (Marginal Likelihood / Evidence): The total probability of observing evidence across all possible states of the hypothesis.
Generalizing Bayes' Rule: Multiple Hypotheses & Evidence
In diagnostic reasoning, an expert often evaluates multiple hypotheses () given one or more pieces of evidence ().
Critical Assumption: For these formulations to hold, the set of hypotheses as well as the set of evidences must be mutually exclusive and exhaustive.
Case 1: Single Evidence and Multiple Hypotheses
When a single piece of evidence is observed, the posterior probability for hypothesis is:
Case 2: Multiple Evidences and Multiple Hypotheses
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.
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).