Model structure
Conditional independence: when more evidence stops helping
Two variables can be associated overall but independent once something else is known. A weather, traffic, and lateness model shows exactly what that means.
By the BayesLab team · Updated 18 September 2026 · 6 min read
A chain with a deliberate assumption
Use the graph Rain → Traffic → Late. Rain has Yes/No states, Traffic has Heavy/Light states, and Late has Yes/No states. We are making a specific assumption: once traffic is known, rain gives no additional information about lateness. This can be a useful simplified teaching model even if real journeys have other pathways.
Set P(Rain Yes) = 20%. Let heavy traffic have probability 80% when it rains and 30% when it does not. Let lateness have probability 70% in heavy traffic and 10% in light traffic. Complete each binary row with the complementary probability.
| Child | Parent state | First child state | Second child state |
|---|---|---|---|
| Traffic | Rain Yes | Heavy 80% | Light 20% |
| Traffic | Rain No | Heavy 30% | Light 70% |
| Late | Traffic Heavy | Yes 70% | No 30% |
| Late | Traffic Light | Yes 10% | No 90% |
Rain matters before traffic is observed
With no evidence, P(Heavy) = 0.20 × 0.80 + 0.80 × 0.30 = 0.40. Then P(Late Yes) = 0.40 × 0.70 + 0.60 × 0.10 = 0.34. This is the baseline prediction for a journey.
If Rain = Yes is observed, the traffic distribution changes. Averaging over that new distribution gives P(Late Yes | Rain Yes) = 0.80 × 0.70 + 0.20 × 0.10 = 0.58. The chain carries information downstream even though Rain is not a direct parent of Late.
Once traffic is known, rain adds nothing here
Observe Traffic = Heavy. Late is now 70%, from the matching conditional row. Add Rain = Yes and it remains 70%. Change Rain to No and it still remains 70%. That is conditional independence: Late is independent of Rain given Traffic, under this network’s factorisation.
This does not say that rain and lateness are unrelated in general. We just saw lateness change from 34% to 58% when rain was observed. “Independent” and “conditionally independent” answer different questions.
Run the experiment in BayesLab
In BayesLab, start a blank network. Use Chance node (C) to add variables and the States tab to name their outcomes. Use Connect (A) to link parent to child, then select each node’s Table tab to enter its probabilities. The tables below use percentages: enter values such as 20% explicitly. Match the state labels, not just the order of the rows. Set observations in the Evidence tab and clear them between experiments.
- Create the three-node chain and enter the prior and CPTs above. Verify the baseline Late probability is 34%.
- Observe Rain = Yes. Confirm Late rises to 58%.
- Add Traffic = Heavy. Confirm Late is now 70%.
- Change Rain to No while retaining Heavy traffic. Check that Late stays 70%.
- Clear all evidence before your next experiment. Download the model to keep the assumptions alongside your notes.
When should you change the structure?
Suppose rain can also delay walking from the car park even at a fixed traffic level. The chain’s assumption may then be too strong for the question you care about. Adding Rain → Late would let the lateness table depend on both variables, but you would need to specify those extra rows. Structure is a claim about what information matters, not just a tidy drawing.
Compare this with a collider, where conditioning can open a path. For the general graphical rules, see CMU’s Bayes net course notes.