A Bayesian network is a directed acyclic graph where:
- Each node is a random variable.
- Each edge means directly influences .
- Each node has a conditional probability distribution .
The joint distribution factorizes as:
Why this is a big deal
A joint distribution over binary variables has free parameters. A Bayesian network can describe the same distribution using only parameters where is the maximum number of parents. For graphs with bounded fanin, this is an exponential reduction.
Conditional independence
Reading the graph tells you which variables are conditionally independent. d-separation is the formal rule: and are conditionally independent given if every path between them is blocked by (where "blocked" follows specific rules for chain, fork, and collider structures).
Bayes nets aren't just storage — they encode conditional independence assumptions that have semantic meaning.
Canonical example
The "alarm" network: a burglary or earthquake can trigger your alarm; if the alarm goes off, neighbors John and Mary may call. The graph is:
- Burglary, Earthquake → Alarm
- Alarm → JohnCalls, MaryCalls
If you observe JohnCalls and MaryCalls, you can infer (probabilistically) about the alarm, which tells you about burglary and earthquake. The math falls out from Bayes' rule on the factored distribution.
Inference tasks
- Marginal: — total probability of .
- Conditional: given evidence .
- Most likely explanation (MAP): .
- Most probable configuration: .
Complexity
Exact inference in general Bayes nets is NP-hard. Polynomial in the size of the network only for tree-shaped graphs. For practical graphs, you use either:
- Variable elimination / junction tree algorithms (exact when tree-width is small).
- Sampling (next lesson).
Modern relevance
Bayes nets dominated structured probabilistic reasoning from the 1990s to 2010s. Deep learning ate a lot of that turf, but Bayes nets remain crucial for:
- Decision support (medical diagnosis, fault detection).
- Causal inference (Pearl's causality machinery).
- Cases where data is scarce and structure can be elicited from experts.