Quant Memo
Advanced

Probabilistic Graphical Models

A joint probability over many variables is too big to write down directly the moment you have more than a handful of them — a probabilistic graphical model draws the dependencies as a graph instead, so the joint distribution factors into small, manageable pieces.

Prerequisites: Bayesian Inference, Markov Chains

Ten binary variables — say, whether ten different sectors are "risk-on" or "risk-off" today — have a joint probability distribution with 210=1,0242^{10} = 1{,}024 possible combinations, each needing its own probability. Fifty variables need 2502^{50} — more numbers than could ever be estimated from any realistic amount of data, let alone stored. Almost none of that complexity is necessary in practice, because most variables don't directly depend on most other variables — energy sector sentiment doesn't need forty intermediate connections to explain oil prices, it depends on oil prices directly and on little else. A probabilistic graphical model writes down exactly which variables directly depend on which, as a graph, and uses that graph to factor the impossible full joint distribution into a handful of small, estimable pieces.

The analogy: an org chart instead of a full meeting transcript

Imagine trying to predict everyone's mood in a fifty-person company by writing down, for every possible combination of fifty individual moods, how likely that exact combination is — an absurd task. Now imagine instead drawing the org chart: each person's mood depends mainly on their direct manager's mood and their own immediate team's situation, not on the mood of someone in an unrelated department three floors away. The org chart doesn't capture every possible influence — it's a simplification — but it captures the influences that actually matter, and it turns an impossible fifty-variable joint prediction problem into fifty small, local ones: "given my manager's mood, what's my mood likely to be?" A graphical model is exactly this kind of org chart, built for probability distributions instead of moods.

The mechanism: factoring a joint distribution along a graph

A Bayesian network is a graphical model built on a directed graph with no cycles, where each variable's node points from its direct causes to itself. The joint probability of all variables factors as a product over each variable, conditioned only on its direct parents in the graph:

P(x1,x2,,xn)=i=1nP(xiparents(xi))P(x_1, x_2, \ldots, x_n) = \prod_{i=1}^{n} P\big(x_i \mid \text{parents}(x_i)\big)

Here xix_i is the ii-th variable, parents(xi)\text{parents}(x_i) is the set of nodes with an arrow pointing directly into xix_i in the graph (its direct causes, and nothing farther upstream), and \prod means multiply across all nn variables. In words: the full joint probability breaks apart into small local factors, one per variable, each conditioned only on its direct parents rather than on every other variable in the system. If a variable has no parents at all, its factor is just its own unconditional probability. This factorization is not an approximation forced onto the data — it is exactly the true joint distribution whenever the graph correctly captures which variables directly influence which, because the graph structure literally encodes a set of conditional-independence assumptions: any two variables not directly connected are assumed conditionally independent given their parents.

The saving in numbers needed is dramatic. Ten binary variables with a naive joint table need 2101=1,0232^{10}-1 = 1{,}023 independent numbers. The same ten variables, if each has at most 2 parents in a graphical model, need at most 10×22=4010 \times 2^2 = 40 numbers (one small conditional table per variable) — a difference of more than 25×, and the gap widens explosively as the variable count grows.

oil price energy sentiment airline costs market risk appetite
Market risk appetite's parent is energy sentiment alone in this graph — it doesn't need a direct edge from oil price, because that influence already flows through energy sentiment.

Worked example 1: factoring a 3-variable joint

Take the graph oil price (OO) → energy sentiment (EE) → market risk appetite (MM), a simple chain. The full factorization is

P(O,E,M)=P(O)P(EO)P(ME)P(O, E, M) = P(O)\, P(E \mid O)\, P(M \mid E)

Suppose P(O=high)=0.3P(O{=}\text{high}) = 0.3, P(E=positiveO=high)=0.8P(E{=}\text{positive}\mid O{=}\text{high}) = 0.8, and P(M=risk-onE=positive)=0.7P(M{=}\text{risk-on}\mid E{=}\text{positive}) = 0.7. The joint probability of all three specific outcomes together is

P(O=high,E=positive,M=risk-on)=0.3×0.8×0.7=0.168P(O{=}\text{high},\, E{=}\text{positive},\, M{=}\text{risk-on}) = 0.3 \times 0.8 \times 0.7 = 0.168

Only three small numbers were needed — P(O)P(O), P(EO)P(E\mid O), P(ME)P(M\mid E) — never a giant table over all joint combinations of OO, EE, and MM simultaneously, and this factored answer, 0.1680.168, is exactly the same number a full joint table would have given for this specific combination, had one been built directly.

Worked example 2: reading off conditional independence

In the same chain graph, MM (market risk appetite) has only EE as a parent, not OO directly. This graph structure asserts MM is conditionally independent of OO given EE — once you know EE, learning OO's value adds nothing further about MM. Check this with numbers: suppose P(E=positiveO=low)=0.75P(E{=}\text{positive}\mid O{=}\text{low}) = 0.75 (almost as high as the 0.80.8 from O=highO{=}\text{high}) and MM's probability still only depends on EE: P(M=risk-onE=positive)=0.7P(M{=}\text{risk-on}\mid E{=}\text{positive}) = 0.7 regardless of which value of OO produced that EE. Whether OO was high or low, once E=positiveE{=}\text{positive} is known, M=risk-onM{=}\text{risk-on} has the same 0.70.7 probability either way — exactly what the missing direct edge between OO and MM claims. If instead MM's probability changed depending on OO's value even after conditioning on EE, that would mean the graph is wrong — it's missing a real direct dependency that should have been drawn in as an edge.

A graph in a probabilistic graphical model isn't decoration — it's a precise, checkable claim about which variables directly depend on which. Every missing edge is a conditional independence assumption, and the joint distribution factors exactly along the graph whenever those assumptions hold.

What this means in practice

Graphical models underlie a huge range of applied probabilistic reasoning in finance: hidden Markov models for regime detection are a graphical model with a chain structure, Bayesian network credit risk models factor default probability through explicit causal chains (macro conditions → sector health → firm-level default), and Markov random fields extend the same factoring idea to undirected graphs where influence flows both ways rather than causally. The core payoff everywhere is the same: turning an intractable full joint distribution into a small set of local, estimable conditional distributions, tied together by a graph that can be inspected, questioned, and revised.

Drawing an edge between two variables is easy; the harder and more consequential mistake is omitting one that actually exists. A missing edge is a strong, silent claim of conditional independence, and if that claim is false — say, oil price genuinely has a direct effect on market risk appetite that doesn't route entirely through energy sentiment — the factored joint distribution will be systematically wrong even though every individual conditional probability in it was estimated correctly. Graph structure errors don't show up as visibly wrong numbers; they show up as a subtly biased joint distribution that looks plausible variable by variable.

Practice

  1. Extend the chain graph with a fourth variable, "credit spreads," as a second parent of "market risk appetite" alongside energy sentiment. Write out the new factorization of the full joint distribution.
  2. In the worked example, if P(ME=positive)P(M\mid E{=}\text{positive}) actually differed depending on whether OO was high or low, what would that imply about the graph's correctness?
  3. A ten-variable system where every variable has at most 3 parents needs roughly how many small conditional-probability numbers, compared to a naive joint table over 2102^{10} combinations? Use the same counting approach as the worked comparison above.

Related concepts

Practice in interviews

Further reading

  • Koller & Friedman, Probabilistic Graphical Models (2009)
  • Bishop, Pattern Recognition and Machine Learning, ch. 8
ShareTwitterLinkedIn