# Checking for conditional independence in graphical models

I would like to know whether $$B \perp\kern-5pt\perp C | D,A$$ and $$D \perp\kern-5pt\perp A | B,C$$ in the following two graphical models and would like to know if my reasoning is correct:

For the left graphical model (Belief Network):

Checking $$B \perp\kern-5pt\perp C | D,A$$: We have that \begin{align} P(B,C|D,A) &\propto \sum_E P(B)P(A|B)P(C|A)P(D|B,C)P(E|D)\\ &= P(B)P(A|B)P(C|A)P(D|B,C). \end{align}

We can see that there is a term, $$P(D|B,C)$$ which contains both $$B$$ and $$C$$, so this means that the probability does not factorize into a product of a function of $$B$$ and a function of $$C$$, hence $$B$$ and $$C$$ are not independent given $$D$$ and $$A$$.

Question 1 Is this correct? And also, would it be correct to just say that since $$D$$, which is in the conditioning set, is a collider for $$B$$ and $$C$$, hence no independence?

Checking $$D \perp\kern-5pt\perp A | B,C$$: We have that \begin{align} P(D,A|B,C) &\propto \sum_E P(B)P(A|B)P(C|A)P(D|B,C)P(E|D)\\ &= \underbrace{P(B)P(A|B)P(C|A)}_{f(A)}\underbrace{P(D|B,C)}_{f(D)}. \end{align}

We can see that the probability factorizes into a product of functions of $$A$$ and $$D$$, hence $$A$$ and $$D$$ are independent given $$B$$ and $$C$$.

Question 2 Is this correct? Would it be correct to just say that we have no colliders in the conditioning set, hence independence?

For the right graphical model, which is a Markov Network, I use the following method:

1. Remove all edges from both $$A$$ and $$D$$
2. Check if there is a path leading from $$B$$ to $$C$$

Checking $$B \perp\kern-5pt\perp C | D,A$$: we can see that if we remove all edges connected to $$A$$ and $$D$$, then there are no paths from $$B$$ to $$C$$. Similar reasoning to deduce that $$D \perp\kern-5pt\perp A | B,C$$.

Question 3: Is this a correct way to approach this problem?

I don't think your first reasoning is correct, because you would still have to show that $$p(D|B, C)$$ cannot be factored into $$f(B)g(C)$$ for some functions $$f,g$$.
Your second reasoning is correct: Since $$D$$ is a collider on the path $$B\to D \leftarrow C$$, conditioning on $$D$$ results in a d-separation open path from $$B$$ to $$C$$, so they can be dependent.

This is correct. The fact that you don't have to sum over $$B$$ and $$C$$, because they are conditioned on, creates the factorization we require. And the graph-based explanation is also correct: both paths $$A\leftarrow B\to D$$ and $$A\to C\to D$$ are (d-separation) blocked by conditioning on $$B, C$$ (because they are no colliders).