brand banner

Updated

Conditional Independence

𝐴 and 𝐡 are independent β‡’ 𝑃(𝐴|𝐡)=𝑃(𝐴) and 𝑃(𝐡|𝐴)=𝑃(𝐡).

Bayes theorem:

𝑃(𝐺|𝐻)=𝑃(𝐺∩𝐻)𝑃(𝐻)

So, in the case 𝐴 and 𝐡 are independent,

𝑃(𝐴|𝐡)=𝑃(𝐴∩𝐡)𝑃(𝐡)=𝑃(𝐴)𝑃(𝐴∩𝐡)=𝑃(𝐴)𝑃(𝐡)

For conditional independence, we say 𝐴 and 𝐡 are independent given 𝐢.

𝑃(𝐴|𝐡∩𝐢)=𝑃(𝐴|𝐢)𝑃(𝐡|𝐴∩𝐢)=𝑃(𝐡|𝐢)

In English, 𝑃(𝐴) is the same as long as 𝐢 has happened, regardless of whether or not 𝐡 happens.

We want to show that since 𝐴 and 𝐡 are conditionally independent:

𝑃(𝐴∩𝐡|𝐢)=𝑃(𝐴|𝐢)𝑃(𝐡|𝐢)

.

Here,

𝑃(𝐴∩𝐡|𝐢)=𝑃(𝐡|𝐢)𝑃(𝐴|𝐡∩𝐢)

means β€œassuming 𝐢 is true, the probability of 𝐴 and 𝐡 both happening is the same as the probability 𝐡 happens when C is first true, and then 𝐴 happens on top of that”.

Bayes’ theorem backs this up:

𝑃(𝐴|𝐡∩𝐢)=𝑃(𝐴∩𝐡∩𝐢)𝑃(𝐡∩𝐢)𝑃(𝐡|𝐢)=𝑃(𝐡∩𝐢)𝑃(𝐢)𝑃(𝐴∩𝐡|𝐢)=𝑃(𝐴∩𝐡∩𝐢)𝑃(𝐢)=𝑃(𝐡∩𝐢)𝑃(𝐢)×𝑃(𝐴∩𝐡∩𝐢)𝑃(𝐡∩𝐢)

So,

𝑃(𝐴∩𝐡|𝐢)=𝑃(𝐴|𝐢)×𝑃(𝐡|𝐴∩𝐢)=𝑃(𝐡|𝐢)×𝑃(𝐴|𝐡∩𝐢)

Remembering Eq.Β 3:

𝑃(𝐴∩𝐡|𝐢)=𝑃(𝐴|𝐢)×𝑃(𝐡|𝐢)=𝑃(𝐡|𝐢)×𝑃(𝐴|𝐢)𝑃(𝐴∩𝐡|𝐢)=𝑃(𝐴|𝐢)×𝑃(𝐡|𝐢)

.

This is the naΓ―ve Bayes assumption (also called conditional independence of the evidence).

Once the class is known, the features do not influence each other:

𝑃(𝑒1,…,𝑒𝑛|β„Ž)=𝑃(𝑒1|β„Ž)𝑃(𝑒2|β„Ž)⋯𝑃(𝑒𝑛|β„Ž)=βˆπ‘˜=1𝑛𝑃(π‘’π‘˜|β„Ž).

Without this assumption, the chain rule from Eq.Β 5 causes an uncontrolled explosion of terms:

𝑃(𝑒1|β„Ž)𝑃(𝑒2|β„Ž,𝑒1)𝑃(𝑒3|β„Ž,𝑒1,𝑒2)β‹―

Β© 2026 James Yap

Personal Website and Knowledge Base