# Is there any way to merge two conditional probability distributions?

Is there any way to construct an expected conditional probability distribution of the form p(x|(y,z)) if I am starting with p(x|y) and p(x|z)? All variables are categorical.

My specific problem deals with a DNA multiple-sequence alignment. Abstractly, I have a two-dimensional dataset, where each position can hold one of four values {G,A,C,T}. The rows are genomes and the columns are aligned positions in the different genomes. I want a way to judge if the observed value is surprising given what I know about the row and column in which it is observed. My intention is to identify regions of a chromosome (a portion of a row, ~1000 columns wide) where the observed values would not have been predicted based on the characteristics of the row and the specific columns. I can easily infer the probability of observing a given outcome (e.g. x = G) for both the row and the column, but I don't know how I would merge those expectations into a single set of expected frequencies.

I would like to say that I am assuming that Y and Z are independent, but I don't know if that's meaningful in this scenario. One obvious constraint is that if a particular outcome is forbidden by one of the predictors, then it cannot occur at the intersection of the two predictors. For example, if the column is uniform (e.g. the genomes are monomorphic) then it doesn't matter what the probability distribution is for the row in question.

I feel like I'm missing something obvious, and I have an intuitive solution but am unable to prove it to myself. Any suggestions would be appreciated.

• Why don't you just measure column-wise? If a column is 99% G and Bob has an A, then Bob is weird, at least at that position. I'm having trouble seeing how the row enters into it at all. What difference would it make whether Bob has 99% G or 99% A in his row in my example? Is the idea that you might dismiss the fact that Bob is weird at this particular position because Bob is weird overall?
– Bill
Apr 24 '14 at 18:31
• @Bill: That is basically how I'm dealing with it -- "Bob always has an A; that's just how he is, nothing to see here". My ultimate goal is to incorporate more information about how the sites (columns) and individuals (rows) relate to each other... but I feel like this adjustment is a major sticking point. Apr 24 '14 at 19:05
• It sounds like you're looking to determine whether the values at a given position are at random, or if certain values in {G,A,C,T} occur with non-random frequency in a some positions within each genome, is that correct? Apr 24 '14 at 20:58
• In general you can't combine $p(x|z)$ and $p(x|y)$ to get $p(x|y,z)$. It doesn't even work with expectation, which is why we don't replace two way anova with two one-way anovas. Apr 25 '14 at 1:34
• That's exactly the situation I am talking about. See Simpson's paradox, for example, especially the first diagram. Apr 26 '14 at 7:41