Probabilistic Graphical Models
Introduction
What Question Does It Ask?
Probabilistic graphical models represent the joint distribution of many uncertain variables with a graph: nodes are variables and edges are direct dependencies. The conditional independences encoded by the graph break a huge distribution into small pieces, making it possible both to model and to query it.
At a glance
probability and graphs combined
variables, dependencies, data
conditional probability, best explanation
likelihood, inference accuracy
high: probability
moderate
Introduction
A Short History
Markov studies chains in which the next state depends only on the current one.
Baum and Petrie publish the statistical basis of the hidden Markov model (HMM).
Dempster, Laird and Rubin publish the EM algorithm for learning with missing data.
Pearl's "Probabilistic Reasoning in Intelligent Systems" brings Bayesian networks into AI.
Rabiner's HMM tutorial becomes the standard reference in speech recognition.
Lafferty, McCallum and Pereira propose conditional random fields (CRFs) for sequence labeling.
The Course
Core Concepts
Probability of every combination of values of all variables.
Once one variable is known, the others no longer affect each other.
Directed acyclic graph; a conditional probability table at each node.
Undirected graph; relations given by potential functions.
An unobserved chain of states, each emitting an observation.
Variable elimination, junction tree.
Sampling (MCMC), loopy belief propagation, variational.
Parameters (EM) and structure: finding the graph itself from data.
The Course
A Typical Workflow
The Course
What Does the Course Cover?
- Probability review; joint distributions, factorization
- Bayesian networks and d-separation
- Markov networks and factor graphs
- Exact inference: variable elimination
- Belief propagation and the junction tree
- Inference by sampling: Gibbs, MCMC
- Variational inference
- Hidden Markov models: forward-backward, Viterbi
- Conditional random fields and sequence labelling
- Parameter learning: maximum likelihood, Bayesian
- Learning with missing data: the EM algorithm
- Structure learning and a first look at causality
Skills you will gain
A typical semester; the order and coverage vary between universities.
Try It
Why Is the Grass Wet?
The grass is wet in the morning: did it rain, or did the sprinkler run? Click a node in the four-variable Bayesian network to set evidence (yes / no / unknown); the other nodes are updated by exact probability calculation.
Context
Prerequisites
Courses worth knowing before this one, and why they are needed.
| Course | Why it is needed |
|---|---|
| Probability and Statistics | conditional independence, joint distribution |
| Algorithms | graph traversal, dynamic programming (Viterbi, forward-backward) |
| Data Structures | graph representation, trees and priority queues |
Context
Are You Ready for This Course?
Ask yourself; for every "no", the right-hand column shows where to start.
| Ask yourself | If not, start with |
|---|---|
| Can you compute a conditional probability with Bayes' rule? | Probability and Statistics |
| Can you store a graph as an adjacency list and traverse it? | Graph representations from a data structures course |
| Can you solve a problem by splitting it into subproblems with dynamic programming? | Dynamic programming from an algorithms course |
| Can you explain maximum likelihood estimation with an example? | Machine Learning |
Context
Neighbouring Courses
Overlap
Overlapping Courses
| Relation | Course | Shared ground |
|---|---|---|
| builds on | This course builds on Probability and Statistics | conditional independence, joint distribution |
| shares methods | Shares methods with Machine Learning | probabilistic classifiers, EM algorithm |
| shares methods | Shares methods with Natural Language Processing and Text Mining | hidden Markov model, conditional random field |
| shares methods | Shares methods with Expert Systems and Knowledge Representation | inference under uncertainty |
| shares methods | Shares methods with Generative Models | latent variable models, variational inference |
| shares methods | Shares methods with Bioinformatics | hidden Markov models for sequence alignment |
Differences
Where It Differs (1/2)
| Criterion | Graphical Models | Probability & Statistics | Machine Learning |
|---|---|---|---|
| Core question | How do we model and query many interdependent, uncertain variables? | How is uncertainty measured, and how do we draw reliable conclusions from limited data? | How does a program generalize from examples? |
| Approach | probability and graphs combined | probability models and inference | statistical learning |
| Input | variables, dependencies, data | sample data | labeled or unlabeled examples |
| Output | conditional probability, best explanation | estimate, confidence interval, test result | a model that makes predictions |
| Success measure | likelihood, inference accuracy | unbiasedness, power, significance | error on unseen data |
| Math load | high: probability | the theory itself | high: linear algebra, probability, optimization |
| Data needs | moderate | a sample | moderate to large |
- Probability & Statistics: Probability and statistics studies distributions of a few variables; this course teaches modeling hundreds of variables by factoring them with a graph.
- Machine Learning: ML usually predicts a single target; a PGM builds the joint distribution of all variables and lets you query any of them.
Differences
Where It Differs (2/2)
| Criterion | Graphical Models | Generative Models | Expert Systems |
|---|---|---|---|
| Core question | How do we model and query many interdependent, uncertain variables? | How does a model generate new samples that look like real data? | How is an expert's knowledge written down and used for inference? |
| Approach | probability and graphs combined | learning the data distribution | symbolic logic and rules |
| Input | variables, dependencies, data | huge, mostly unlabeled data | facts and expert rules |
| Output | conditional probability, best explanation | new samples: images, text, audio | conclusion with justification |
| Success measure | likelihood, inference accuracy | realism and diversity (FID etc.) | expert agreement, explainability |
| Math load | high: probability | high | low: propositional and predicate logic |
| Data needs | moderate | very large | little; a knowledge base |
- Generative Models: Generative models use large neural networks to produce samples; this course focuses on explicit, interpretable structure and exact inference.
- Expert Systems: Expert systems write knowledge as crisp rules; a PGM writes the same knowledge with probabilities and combines evidence consistently.
Practice
Applications
Disease probability from symptoms and tests.
Word sequences from audio with HMMs.
Part-of-speech and named entity tagging (CRF).
Gene finding and sequence alignment.
Most likely fault from observed symptoms.
Label agreement of neighboring pixels (MRF).
Practice
Risks and Ethics
Without data, probability tables are filled with expert guesses; a precise-looking 83 per cent hides how uncertain those guesses are.
Treating two dependent pieces of evidence as independent counts the same information twice and makes the model overconfident.
Mistaking the chance of the evidence for the chance of guilt (the prosecutor's fallacy) and ignoring base rates can convict the innocent.
Stop an MCMC chain too early and the posterior is wrong; results cannot be trusted without reported convergence diagnostics.
In depth: Explainable AI and AI Ethics.
Practice
Tools and Datasets
Tools and libraries
Classic networks and datasets
Practice
Common Misconceptions
| Common belief | In fact |
|---|---|
| An edge means cause and effect. | In a Bayesian network an edge is only a probabilistic dependency; causality needs extra assumptions or experiments. |
| Unconnected variables are independent. | Independence is conditional; two nodes can become dependent once a common child is observed. |
| Inference is always easy to compute. | Exact inference on general graphs is NP-hard; large models need approximate methods. |
| Deep learning made this field obsolete. | PGMs remain strong where data is scarce and explainability or uncertainty estimates matter; the two are also combined. |
Next Steps
After This Course
Courses that build on or extend this one
Related careers
Next Steps
Further Reading
- Koller and Friedman, Probabilistic Graphical Models: Principles and Techniques, MIT Press, 2009.
- Pearl, Probabilistic Reasoning in Intelligent Systems, Morgan Kaufmann, 1988.
- Murphy, Machine Learning: A Probabilistic Perspective, MIT Press, 2012.
- Darwiche, Modeling and Reasoning with Bayesian Networks, Cambridge University Press, 2009.
- Rabiner, "A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition", Proceedings of the IEEE 77(2), 1989.