# Is it always possible to find a joint distribution $p(x,y)$ consistent with the results of both labs?

I am reading "Bayesian Reasoning And Machine Learning" and doing exercise 4.8 and would like to check if the following reasoning is correct.

Two research labs work independently on the relationship between discrete variables $$x$$ and $$y$$. Lab A proudly announces that they have ascertained distribution $$p_A(x|y)$$ from data. Lab B proudly announces that they have ascertained $$p_B(y|x)$$ from data.

1. Is it always possible to find a joint distribution $$p(x,y)$$ consistent with the results of both labs?

2. Is it possible to define consistent marginals $$p(x)$$ and $$p(y)$$, in the sense that $$p(x)=\sum_yp_A(x|y)p(y)$$ and $$p(y)=\sum_xp_B(y|x)p(x)$$? If so, explain how to find such marginals. If not, explain why not.

My attempt:

First I want to say that I'm slightly confused as to why there is such a question, when the chapter is about Markov Networks/Chain Graphs/Factor Graphs. This doesn't seem connected to me. Could someone explain exactly how this is connected to those topics?

So my answer to the first question is:

Assuming the distribution of the sampe sets $$S=\{(x,y)\}$$ is random, it may not be possible to always come to the same conclusion about the relationship of the the variables because sometimes there may be a sample which doesn't properly represent the general trend in the data.

No, since as above stated, there may be misrepresentative samples.

• Hint: These questions appear to be aimed at preparing for a discussion of reversible Markov Chains and (likely) MCMC methods.
– whuber
Oct 26, 2021 at 19:59
• @Tim I thought you have answered this question, why did you delete the answer? Oct 26, 2021 at 20:50

The question is asking about whether the two conditional distributions are sufficient for construction of a joint distribution. Recall that conditional distributions are ratios of a joint and a marginal. So that a ratio of the two will cancel and you'll be left with a ratio of two marginals:

$$\sum_{\forall x}\frac{p_A(x|y)}{p_B(y|x)} = \sum_{\forall x}\frac{p_A(x,y)p_B(x)}{p_A(y)p_B(y,x)}$$

Now if we are willing to assume that $$p_A(x,y) \equiv p_B(x,y)$$ then these joint distributions cancel and you'll get

$$\sum_{\forall x}\frac{p_B(x)}{p_A(y)} = \frac{1}{p_A(y)}.$$

So write

$$\frac{p_A(x|y)}{\sum_{\forall x}\frac{p_A(x|y)}{p_B(y|x)}} = p_A(x|y)p_A(y)$$

which is the joint distribution by definition. Note we needed to assume the the joint distributions are the same and that the joint distributions exist, this latter point is crucial for continuous distributions. Also, similar reasoning can get the joint distribution from lab B, just switch the numerator and denominator and sum over $$y$$ instead of $$x$$.

This sort of result is often referred to as the Clifford-Hammersley theorem in the MCMC literature.