The PC algorithm
How the PC algorithm finds a causal graph with independence tests, step by step, what it assumes, what its output means, and when to use it.
In short
PC, named after its authors Peter Spirtes and Clark Glymour, is one of the oldest and most widely used causal discovery methods. It starts with every pair of variables linked, removes the links that independence tests reject, then orients the links whose direction the remaining pattern decides.
How it works, step by step
- Start full. Every variable is linked to every other one, without directions.
- Remove links. For each pair, PC tests whether they are independent: first on their own, then given one other variable, then two, and so on. As soon as a test finds a set of variables that makes the pair independent, the link goes. Most links disappear early, which is why PC is fast on sparse data.
- Orient colliders. When A and B are not linked but both are linked to C, and C was not needed to separate them, the only explanation is A → C ← B.
- Propagate. A few rules extend those directions to other links without creating new colliders or cycles. Links no rule can orient stay undirected.
What it assumes
- No hidden common causes. Every variable that drives two others is in the table. If not, use FCI.
- Faithfulness. Independences in the data come from the graph, not from effects that cancel out by coincidence.
- The right test. UCMT Labs runs PC with Fisher-z tests (causal-learn), which suit roughly linear relationships with bell-shaped noise.
- No feedback loops. The graph is acyclic.
How to read its output
PC returns a partially directed graph (a CPDAG). An arrow is a direction the data supports; an undirected link is one the data cannot orient, because several graphs explain it equally well. That is information, not failure: it shows where knowledge or an experiment is needed. PC reports no confidence per link; in UCMT Labs the Confidence tile reads "not reported" for PC runs.
When to use it
- A first, transparent baseline on most numeric tables.
- Many variables with few links each.
- When you want to see exactly why a link was removed.
Consider another method when relationships are clearly curved, when noise is strongly skewed (see LiNGAM) or when a key cause is missing (see FCI).
Practical tips
- With few rows, tests miss weak links: the graph comes out sparser than the truth.
- Near-copies of a variable (the same measure in two units) confuse the tests; keep one.
- Compare PC with a score-based method such as GES: links both keep are firmer.