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.