1

In this answer the author expands a following term: $P(a,z|b) = P(a|z,b) P(z|b)$ I am stuck at calculation of this expansion.

My calculations:

applying the formula $P(x,y) = P(x|y) P(y)$

I get following: $P(a,z|b) = P(a|(z|b)) P(z|b) = P((a|z)|b)) P(z|b)$

Using Bayes rule: $P((a|z)|b)) = \frac{P(b,a|z)}{P(b)} = \frac{P(a|z,b)}{P(b)}$

How do I get from $\frac{P(a|z,b)}{P(b)}$ to $P(a|z,b)$ ?

Alina
  • 123

1 Answers1

1

Your deduction $$P(x,y) = P(x|y) P(y)\implies P(a,z|b) = P(a|(z|b)) P(z|b) = P((a|z)|b)) P(z|b)$$

is wrong. Actually, the expression $P(a\mid (z\mid b))$ does not make sense ($z \mid b$ is neither an event nor a random variable)

The natural way is, seeing that in the target equation everything is conditioned on $b$, start from the "unconditioned" variables $$P(a,z) = P(a \mid z) P(z) \tag{1}$$ and then condition everything on the third variable $b$, which leads us to

$$P(a,z\mid b) = P(a \mid z,b) P(z \mid b) \tag{2}$$

Alternatively, (but I encourage you to get familiar with the procedure above, it's quite frequent and practical) you can write out all the definitions:

$$P(a,z\mid b)=\frac{P(a,z,b)}{P(b)}$$ $$P(a,\mid z,b)=\frac{P(a,z,b)}{P(z,b)}$$ $$P(z\mid b)=\frac{P(z,b)}{P(b)}$$

Putting all together, you get $(2)$

leonbloy
  • 63,430