Modelling practice
Your model gives a surprising answer. What now?
A surprising posterior can reveal a mistake—or teach you something important. Use a small reference model and a repeatable sequence of checks to tell the difference.
By the BayesLab team · Updated 18 September 2026 · 6 min read
Make a tiny model with a known answer
Our fictional reference model is Power → Lamp. Power has states On/Off with probabilities 80%/20%. Lamp has states Lit/Dark. When power is On, the lamp is Lit with probability 95%; when power is Off, it is Lit with probability 5%. The latter value allows an alternative power source in this simplified example.
| Power | Lit | Dark |
|---|---|---|
| On | 95% | 5% |
| Off | 5% | 95% |
Before evidence, P(Lit) = 0.80 × 0.95 + 0.20 × 0.05 = 0.77. After observing Dark, P(Power On | Dark) = 0.80 × 0.05 / 0.23 ≈ 17.39%. Write those two answers down before opening the software. They are your reference checks.
1. Check what every state means
“On” and “Lit” sound similar but belong to different variables. Read a table row aloud: “When power is on, the chance the lamp is lit is 95%.” Reversed labels can produce a valid-looking table with the wrong meaning. Set names and state order before entering values, and recheck the tables after editing a state.
2. Check the distributions, not just individual cells
Every chance-node row must total 100%, with no negative entries. In this example 95% and 5% form a complete distribution. A row containing 95% and 95% is not two strong beliefs; it is inconsistent. Normalising can fix the total mathematically, but it cannot tell you which original number you intended.
3. Clear old evidence
A node’s table stores the model, while evidence stores an observation. If the lamp is already observed Dark, the display shows the conditional answer, not the baseline. Clear all observations and check for the 77% Lit result. Then set Dark and check 17.39% for Power On. Change one thing at a time and record it.
4. Check the direction of the question
P(Dark | Power On) is 5%, directly from a table row. P(Power On | Dark) is about 17.39%, after combining the prior with both possible explanations. Do not reverse an arrow simply because you want to ask the reverse question: Bayesian inference can update beliefs upstream from evidence.
5. Test an extreme case
Temporarily set the Power On prior to 100%. With Dark observed, Power On should remain 100% because the model still assigns a nonzero chance to a dark lamp while power is on. Save a copy first and restore the original 80%/20% prior afterward. Extreme cases expose misunderstandings that ordinary-looking numbers can hide.
Run the check 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 reference model exactly as specified and verify the no-evidence result.
- Observe Dark and compare the posterior with your hand calculation.
- If the numbers differ, inspect state labels, each row total, existing evidence, and inference mode. If Manual mode is selected, press Run after changes.
- Save the smallest model that reproduces the difference, together with your expected result and calculation. This makes a useful question for a tutor or a reproducible software report.
When the maths checks out, investigate the assumptions rather than forcing the result to match your intuition. Revisit Bayes’ theorem or CPT construction for a focused refresher.