Bayesian Network

A graphical model that represents the probabilistic relationships among a set of random variables. Uses a directed acyclic graph.

Provides a compact and intuitive representation of joint probability distributions using conditional independence and causal structure.

Node

Represents a random variable.

Each node has a local CPD.

The overall joint probability of all variables is:

P(X1,X2,…,Xn)=∏i=1nP(Xi∣Parents(Xi))P(X_1, X_2, \ldots, X_n) = \prod_{i=1}^{n} P(X_i | \text{Parents}(X_i))

Edge

Directed links. A link from node XX to node YY means that XX has a direct influence on YY.

Local Conditional Probability Distribution

Also known as CPD. A function defining the probability of a variable given its parents.

For a node XiX_i with parents Parents(Xi)\text{Parents}(X_i), the CPD is:

P(Xi ∣ Parents(Xi))P(X_i \,|\, \text{Parents}(X_i))

Specifies the relationship between a node and its parent nodes. Can be continuous or discrete. For discrete variables: represented using conditional probability table (CPT).

A CPT for a boolean variable XiX_i with kk boolean parents has 2k2^k entries.

Joint Probability Distribution

Also known as JPD. The full joint probability for all variables in the network is the product of local conditional probabilities:

Example:

P(B,E,A,J,M)=P(B)⋅P(E)⋅P(A∣B,E)⋅P(J∣A)⋅P(M∣A)P(B, E, A, J, M) = P(B) \cdot P(E) \cdot P(A|B,E) \cdot P(J|A) \cdot P(M|A)

Here:

  • P(B),P(E)P(B), P(E) is used because B,EB, E has no parents.
  • P(A∣B,E)P(A|B,E) because AA depends on both BB and EE.
  • P(J∣A),P(M∣A)P(J|A), P(M|A) because J,MJ, M depend only on AA.

This decomposition avoids the need to represent all combinations explicitly.

Inference

The goal is computing probabilities of interest given evidence.

By Enumeration

P(B∣J,M)=α∑E∑AP(B,E,A,J,M)P(B|J,M) = \alpha \sum_E \sum_A P(B, E, A, J, M)

where α\alpha is a normalization constant ensuring probabilities sum to 1.

This method sums over hidden (unobserved) variables to find the posterior probability.

Conditional Independence

Patterns

Relationship TypeStructureIndependence Property
Common causeX←Y→ZX ← Y → ZXX and ZZ independent given YY
Common effectX→Y←ZX → Y ← ZXX and ZZ dependent given YY
Causal chainX→Y→ZX → Y → ZXX and ZZ independent given YY

Structure

  • Children are conditionally independent of ancestors given parents.
  • Siblings are conditionally independent given their common parent.
  • Parents are generally not conditionally independent given a child.

D-Separation

Used to test independences in a Bayesian network.

Steps:

  1. List all paths between the 2 variables (ignore arrow direction).
  2. For each path, identify the type of connection at each intermediate node
    • Chain
      A→B→CA → B → C or A←B←CA ← B ← C
    • Fork
      A←B→CA ← B → C
    • Collider
      A→B←CA → B ← C
  3. Apply blocking rules
    • For a chain or fork, the path is blocked if the middle node is conditioned.
    • For a collider, the path is blocked if both the collider and its descendents are not conditioned.
  4. They are independent iff all paths between the 2 nodes are blocked.

Compactness and Efficiency

If every node has at most kk parents, total storage = O(n⋅2k)O(n \cdot 2^k). This is linear in n, compared to O(2n)O(2^n) for the full joint distribution.

More compact than full joint tables.

Constructing a Bayesian Network

  • Choose variables relevant to the domain.
  • Decide an ordering of variables (causes before effects preferred).
  • For each variable XiX_i:
    • Add a node for XiX_i.
    • Select minimal parents ensuring conditional independence.
    • Define the CPT for XiX_i.
Written by October 17, 2026 3 min read
Was this helpful?