Bayesian Network (Interactive)

Create a small directed acyclic graph (DAG) of binary variables, specify conditional probability tables, and run exact inference with evidence — right in the browser.

Note: this tool is for learning. For large models use a specialized engine.

1. Nodes

All nodes are boolean: True / False.

3. Inference

Choose a query variable and (optional) evidence. We'll compute P(Query = True | Evidence).

Result:

Bayesian network recap

A Bayesian network is a compact way to encode a joint probability distribution using conditional independencies. Formally, for nodes \( X_1, \dots, X_n \) in a DAG, the joint factorises as:

P(X_1, \dots, X_n) = \prod_{i=1}^n P(X_i \mid \text{Parents}(X_i))

Inference answers questions like \( P(\text{Disease} \mid \text{Test} = +) \). Our tool uses enumeration: it sums over all hidden variables to compute the normalizing constant.

Tips for using this page

  • Keep to 5–6 variables to avoid exponential blowup.
  • Set every CPT row, or inference will assume 0.5.
  • Use the evidence toggles to test diagnostic vs causal queries.

Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted LaTeX)
\[','\\]
','\
Formula (extracted text)
P(X_1, \dots, X_n) = \prod_{i=1}^n P(X_i \mid \text{Parents}(X_i))
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn