I want to calculate $P(x\mid AB)$ where $AB$ is a condition in which both $A$ and $B$ occur.

I know the following data points:

$P(x\mid A)$

$P(x\mid B)$

$P(A\mid B) =$ I can estimate a number. It's not $P(A)$ since there is some dependence between $A$ and $B$.

$P(B\mid A) =$ I can estimate a number. It's not $P(B)$ since there is some dependence between $A$ and $B$.

If necessary, I can also estimate the following:




Is there a way for me to calculate $P(x\mid AB)$?

In case it matters, $x$, $A$, and $B$ are all binary events, either something happens or it doesn't.

Separately, is there a way to generalize this since I am also trying to estimate $P(x\mid ABCD)$ where $C$ and $D$ follow similar rules as $A$ and $B$ as described above.

Thanks for the help!


1 Answer 1


You note that $A$ and $B$ are not (unconditionally) independent. However, if they are independent conditional on $x$, $$ p(A,B|x) = p(A|x)\,p(B|x), $$ then you have enough information to compute $p(x|A,B)$.

First factor the joint distribution two ways: $$ p(x,A,B) = p(x|A,B)\,p(A,B) = p(A,B|x)\,p(x). $$ Using these two factorizations, write Bayes' rule: $$ p(x|A,B) = \frac{p(A,B|x)\,p(x)}{p(A,B)}. $$ You know $p(x)$. You also know $p(A,B)$, since $$ p(A,B) = p(A|B)\,p(B) = p(B|A)\,p(A), $$ and you know $p(A)$, $p(B)$, $p(A|B)$, and $p(B|A)$.

If $A$ and $B$ are conditionally independent you only need $p(A|x)$ and $p(B|x)$, but you know these as well, since (using Bayes' rule again) $$ p(A|x) = \frac{p(x|A)\,p(A)}{p(x)} \qquad\text{and}\qquad p(B|x) = \frac{p(x|B)\,p(B)}{p(x)}, $$ and you know $p(x|A)$ and $p(x|B)$.

Putting this together, one way to write the answer is $$ p(x|A,B) = \frac{p(x|A)\,p(x|B)\,p(A)}{p(x)\,p(A|B)} . $$

Without the assumption of conditional independence (or its equivalent) I don't think you can get the answer with what you know.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.