Day 56. Identification Algorithms & Non-Identifiable Queries
With unobserved confounders drawn as bidirected edges, a graph splits into confounded components. Tian's criterion decides at a glance whether the effect of a single treatment is identified, the c-component factorisation produces the formula, and the general ID algorithm handles everything else.
- ●Convert a DAG with latent variables into an acyclic directed mixed graph (ADMG) and find its c-components.
- ●Apply Tian's criterion to decide whether the effect of a single treatment is identified.
- ●Derive identification formulas from the c-component factorisation, including the front door.
- ●Recognise non-identified designs (bow, instrument) and know the alternatives (bounds, extra assumptions, new data).
Theory
From latent DAGs to ADMGs
If an unobserved has exactly two observed children, , replace it by a bidirected edge . More generally, the latent projection keeps the observed nodes, draws when causes through latent nodes only, and when they share a latent ancestor through latent paths. The result is an acyclic directed mixed graph (ADMG): directed edges are causal, bidirected edges are unmeasured confounding. All identification results can be stated on the ADMG.
c-components
Two nodes are in the same c-component (confounded component, or district) if they are connected by a path made only of bidirected edges. c-components partition the observed nodes. Write for the c-component containing .
The c-component factorisation
For each c-component , define . Tian and Pearl showed that
with the variables in a topological order. So every is identified from observational data.
Tian's criterion (single treatment)
The interventional distribution is identified if and only if there is no bidirected path from to any of its children; equivalently, no child of is in . Then
Marginalise to get .
Beyond the simple criterion
Tian's criterion is about all outcomes at once. A particular can still be identified when the criterion fails (the "napkin" graph, Exercise 10). The general ID algorithm (Shpitser & Pearl, 2006) recursively decomposes the query into c-components and either returns a formula or finds a hedge, a structure that proves non-identification. It is sound and complete, and it is implemented in software (R's causaleffect, Python's y0).
When the answer is "not identified"
Two classic non-identified designs: the bow (, ) and the instrument (, ). Options:
- add assumptions (linearity or monotonicity make the IV design work, Phase 5);
- report bounds (Day 79);
- run a sensitivity analysis (Day 95);
- collect new variables or run an experiment.
Part 1 · Warm-up
Exercise 1 · Find the c-components
ADMG: , , , . List the c-components.
Show solution
Step 1. Follow bidirected edges only: gives ; gives .
Step 2. has no bidirected edges: .
Answer: , , .
Exercise 2 · Apply Tian's criterion
Is the effect of identified? (a) , . (b) , . (c) , . (d) , .
Show solution
Step 1. (a) Child is in : not identified (the bow).
Step 2. (b) ; child is not in it: identified (the front door).
Step 3. (c) : identified (adjust for ).
Step 4. (d) contains the child : not identified.
Exercise 3 · Q factors for the front door
For the ADMG , (order ), write and .
Show solution
Step 1. (the factors for and , each given all predecessors).
Step 2. .
Step 3. Check: the product is .
Exercise 4 · The instrument graph
In , , is identified nonparametrically? Is ?
Show solution
Step 1. For : contains the child : not identified.
Step 2. For : (no bidirected edges at ): identified, and since has no parents, .
Answer: the intention-to-treat effect of the instrument is identified; the effect of needs extra assumptions (linearity, or monotonicity for a LATE).
Exercise 5 · Latent projection
Latent DAG: , , , , , with unobserved and observed. Draw the ADMG and decide whether the effect of on is identified.
Show solution
Step 1. has observed children : draw . : draw .
Step 2. ADMG: , .
Step 3. contains the child : Tian's criterion fails for the full distribution .
Step 4. But for alone, the back-door criterion holds with (the M-structure, Day 53): .
Answer: identified for (not for the joint with ), which illustrates why the criterion concerns all outcomes.
Part 2 · Proofs
Exercise 6 · c-components partition the nodes
Prove that "connected by a bidirected path (or equal)" is an equivalence relation.
Show solution
Step 1. Reflexive: by definition each node is related to itself.
Step 2. Symmetric: bidirected edges have no direction, so a bidirected path from to reversed is one from to .
Step 3. Transitive: join a bidirected path from to with one from to ; the result is a bidirected walk from to , which contains a bidirected path.
Step 4. Equivalence classes partition the node set.
Exercise 7 · The front door from c-components
Use the identification formula in the theory to derive the front-door formula for , .
Show solution
Step 1. , with (Exercise 3).
Step 2. .
Step 3. .
Step 4. Multiply: .
Step 5. Sum over : the front-door formula (Day 54).
Exercise 8 · Why children outside the district matter
Let . Argue that if has no children in , then .
Show solution
Step 1. : marginalising over in the intervened world.
Step 2. .
Step 3. These are equal if, in the world where is fixed, has no causal effect on (Rule 3).
Step 4. Any causal path from starts with an edge to a child; every child is outside , hence in , which is fixed by intervention. So all causal paths are cut.
This is the step that fails when a child of shares its c-component.
Exercise 9 · No confounding at the treatment
Show that if has no bidirected edges, the identification formula reduces to the truncated factorisation in the Markovian case.
Show solution
Step 1. , so , which equals in a Markovian model (Day 47).
Step 2. .
Step 3. So , which is the truncated factorisation (divide out 's factor).
Exercise 10 · The napkin
In the "napkin" ADMG , , , show that Tian's criterion fails. The ID algorithm nevertheless gives
(for any ). Explain why there is no back-door or front-door set.
Show solution
Step 1. (via ); the child is in it: the criterion fails, so is not identified.
Step 2. Back-door paths from to : (open with no conditioning) and (collider at ).
Step 3. Conditioning on blocks the first path but opens the collider on the second. Conditioning on blocks the first path but also opens the second, because is a descendant of the collider . So no set of observed variables is admissible.
Step 4. Front door: has the single child , so no mediator exists.
Answer: identification uses as a conditioning device that is then integrated out over : a formula no single adjustment produces. The code verifies that it equals the truth in a model with strong latent confounding, while the naive comparison and adjustment for are biased.
Part 3 · Applied
Exercise 11 · Minimum wage with unobserved local demand
Counties' minimum wage is set by states; local labour demand (unobserved) affects both state policy and teen employment . Teen wages respond to and affect ; also affects directly through hours rules. Draw the ADMG and decide identifiability. What changes if had no direct arrow to ?
Show solution
Step 1. ADMG: , , (via ).
Step 2. contains the child : not identified.
Step 3. Without the direct arrow, the children of are , outside : identified by the front door through wages.
Answer: identification hinges on whether the minimum wage can affect employment only via wages, a substantive claim to defend or reject.
Exercise 12 · Statins and frailty
Elderly patients' frailty (unobserved) affects both statin prescription and mortality . Frailty also affects adherence . Statins affect cholesterol , which affects mortality; adherence affects cholesterol. Observed: . Draw the ADMG and apply Tian's criterion to the effect of prescription.
Show solution
Step 1. Directed: , , . Bidirected (frailty): , , .
Step 2. . Children of : , not in .
Step 3. Criterion satisfied: identified, with a front-door-like formula that treats as the mediator and adjusts for in its second stage.
Answer: identified, if cholesterol is the only channel for statins' effect, which pharmacology makes debatable (statins also reduce inflammation).
Exercise 13 · Job training with an observed confounder
Graph: motivation (unobserved) affects training and earnings ; prior earnings (observed) affects and ; training affects . Is the effect identified? What if motivation instead affected only and ?
Show solution
Step 1. First case: and is a child of : not identified.
Step 2. Second case: bidirected edge ; : identified. satisfies the back-door criterion (the path is blocked at ).
Answer: whether unobserved factors touch the treatment directly or only through observed pre-treatment variables decides everything.
Exercise 14 · A school health programme (napkin)
A family's health culture (observed index) affects participation in a school health programme , which affects children's exercise habits , which affect BMI . Unobserved household factors link with , and other unobserved factors link with . Is the effect of exercise on BMI identified? How would you compute it?
Show solution
Step 1. ADMG: , , : the napkin.
Step 2. Tian's criterion fails, but the ID algorithm returns the napkin formula of Exercise 10.
Step 3. Computation: for a chosen , compute and divide by .
Answer: identified. The formula is unusual and estimation can be noisy; a practical analyst would also check whether some simpler design applies.
Exercise 15 · When the answer is no
A ministry asks for the effect of hospital ownership type (public vs private) on patient outcomes. Patients choose hospitals partly on unrecorded health status. No mediator captures the whole effect, and no instrument is available. What can you deliver?
Show solution
Step 1. The ADMG contains the bow , (after adjusting for observed covariates): not identified.
Step 2. Options: worst-case or monotone bounds on the effect (Day 79); a sensitivity analysis showing how strong unobserved selection must be to overturn the sign (Day 95).
Step 3. Better data: look for an instrument (distance to the nearest public hospital, ambulance assignment rules) or a natural experiment (ownership conversions over time, Phase 5).
Answer: be explicit that the point effect is not identified, report bounds and sensitivity, and propose a design that would identify it.
Verify in Python
import itertools
import numpy as np
import networkx as nx
def districts(nodes, bidirected):
"""c-components: connected components of the bidirected part."""
B = nx.Graph(); B.add_nodes_from(nodes); B.add_edges_from(bidirected)
return [sorted(c) for c in nx.connected_components(B)]
def tian_identified(directed, bidirected, x):
nodes = {v for e in directed + bidirected for v in e} | {x}
Sx = next(set(c) for c in districts(nodes, bidirected) if x in c)
children = {b for a, b in directed if a == x}
return not (children & Sx)
print("Ex 1:", districts("ABCDE", [("A", "C"), ("B", "D")]))
cases = {"bow": ([("X", "Y")], [("X", "Y")]),
"front door": ([("X", "M"), ("M", "Y")], [("X", "Y")]),
"adjust Z": ([("Z", "X"), ("X", "Y")], [("Z", "Y")]),
"instrument": ([("Z", "X"), ("X", "Y")], [("X", "Y")]),
"statins": ([("X", "C"), ("A", "C"), ("C", "Y")], [("X", "Y"), ("X", "A"), ("A", "Y")]),
"napkin": ([("W", "Z"), ("Z", "X"), ("X", "Y")], [("W", "X"), ("W", "Y")])}
for k, (d, b) in cases.items():
print(f"{k:11s} Tian criterion satisfied: {tian_identified(d, b, 'X')}")
# Exercise 10: the napkin formula in a random model with two latent confounders
pU1, pU2 = .5, .4
pW = np.array([[.1, .5], [.5, .9]]); pZ = np.array([.2, .8]) # pW[u1, u2], pZ[w]
pX = np.array([[.1, .8], [.3, .9]]); pY = np.array([[.1, .7], [.3, .9]]) # pX[z, u1], pY[x, u2]
b = lambda p, v: p if v else 1 - p
P = {}
for u1, u2, w, z, x, y in itertools.product((0, 1), repeat=6):
P[w, z, x, y] = P.get((w, z, x, y), 0) + b(pU1, u1) * b(pU2, u2) * b(pW[u1, u2], w) * b(pZ[w], z) * b(pX[z, u1], x) * b(pY[x, u2], y)
m = lambda **kw: sum(v for k, v in P.items() if all(k["wzxy".index(a)] == val for a, val in kw.items()))
truth = {x: sum(b(pU2, u2) * pY[x, u2] for u2 in (0, 1)) for x in (0, 1)}
for x in (0, 1):
napkin = [sum(m(x=x, y=1, z=z, w=w) / m(z=z, w=w) * m(w=w) for w in (0, 1)) /
sum(m(x=x, z=z, w=w) / m(z=z, w=w) * m(w=w) for w in (0, 1)) for z in (0, 1)]
naive = m(x=x, y=1) / m(x=x)
adjZ = sum(m(x=x, y=1, z=z) / m(x=x, z=z) * m(z=z) for z in (0, 1))
print(f"x={x}: truth {truth[x]:.4f} napkin (z=0, z=1) {napkin[0]:.4f}, {napkin[1]:.4f} naive {naive:.4f} adjust Z {adjZ:.4f}")
Key takeaways
- Bidirected edges encode unmeasured confounding; c-components group variables linked by it, and each c-component's factor is identified.
- Tian's criterion: the effect of a single on all other variables is identified exactly when no child of shares its c-component.
- The ID algorithm is complete; when it says "not identified", turn to bounds, sensitivity analysis, extra assumptions or new data.
Simulation Lab: c-Components & Tian's Criterion
Open full screen →Toggle arrows and hidden-confounder edges; c-components and the identification verdict update live.
No child of X shares its c-component: identified. P(v | do(x)) = P(v) · Σₓ Q[S_X] / Q[S_X].
Switch arrows and bidirected (unmeasured-confounding) edges on and off. Nodes in the same c-component share a colour. Tian's criterion: the effect of X on all other variables is identified exactly when no child of X lies in X's c-component. The napkin shows that P(y | do(x)) for one outcome can still be identified when the criterion fails.