# How to get rid of this variable?

DAG: u is the unknown variable

The equation is originally like this: $$P(q,e,p,c,u) = P(c)P(u)P(p|u)P(e|c,p)P(q|e,u)$$ My goal is to get: $$P(q|\text{do}(c))=\sum_p P(q|c,p)P(p)$$ After some manipulations I got this: $$P(q|c,p,u)P(p|u)P(u)$$ (I used do-calculus rules, the chain rule and the partition theorem to get here)

I want to get rid of the variable $$u$$, thought about using the partition theorem (or law of total probability) where: But, for what I understand, I could use $$P(u)$$ to make either the $$u$$ in $$P(q|c,p,u)$$ disappear or the $$u$$ in $$P(p|u)$$ but not both at the same time.

Is it possible to make the $$u$$ totally disappear from my equation??

• Wouldn't hurt to post your DAG. Looks like $c$ and $u$ are roots? Etc.? May 18, 2020 at 22:27
• Yes I'll do that sorry May 19, 2020 at 14:58
• Do you have $P(u)$? If not, are you able to make some broad assumptions about $P(u)$? Finite first and second moments? Heavy or light tailed? It seems to me that any conclusions you draw will be contingent on these assumptions or meta assumptions? So the best you can do is $P(q|c,u)$, since those two are the ends of the conditional paths. If $P(c)$ is known, then at least you can integrate that out, and have $P(q|u)=\sum_c P(q|c,u)P(c).$ Also, it is not clear why you wish to preserve the conditional on $p$ if you are able to sum over it. May 19, 2020 at 18:03
• As an aside, a really convenient site for making graph diagrams on-the-fly for inclusion in posts here is csacademy.com/app/graph_editor. I made one for you as part of a longer answer, but see now that you have done it yourself. Brava! May 19, 2020 at 18:06
• My goal with all of this is to try to understand how PyAgrum got the equation $P(Q|do(C)) = \sum_p P(Q|C,P)P(P)$, this is called the BackDoor Adjustment in case you don't know it, is a Theorem from Pearl's do-calculus. PyAgrum is a Python library that deals with causal inference and I was using it but I simply do not understand some of the equations returned and I tried to do it myself to see how I could get to the same result. May 19, 2020 at 19:39

If $$C$$ stands for "cluster", and $$Q$$ for "quadrant", then in your DAG
$$P(Q|do(c) = P(Q|c)$$
because there are no back-door paths from $$C$$ to $$Q$$. That is, $$C$$ is as-if randomized.
Further, $$P(Q|c) = \sum_p P(Q|c, p)P(p|c) = \sum_p P(Q|c, p)P(p)$$. The first step is law of total probability. The second step follows because $$C$$ and $$P$$ are d-separated, and so are independent. This is because in your DAG, the paths between $$C$$ and $$P$$ go through colliders ($$E$$ or $$Q$$).