# Creating joint conditional probability distribution

I have a signal gathering system. Every 10 seconds it goes to locations A, B and C and sees whether there is activity or not. It then populates a table which looks like following:

A    B    C
------------
1    0    1
1    1    0
1    0    1
1    0    1
............


There are about 10,000 such rows of data in table.

Now I want to understand $P(B,C|A)$.

My understanding is that I would have 8 cases here like the following: $P(B=1,C=1|A=1)$, $P(B=1,C=1|A=0)$, $P(B=1,C=0|A=1)$, etc.

My questions are :

1. Should I model this as binomial distribution or Dirichlet distribution. Why choose one over the other for this case?

2. I know that the way logic has been coded, B and C are impacted by activity at A. But what if C is also impacted by activity at B. Does considering binomial or Dirichlet distribution factor any interaction between B and C in calculating $P(B=1,C=0|A=1)$ for example?

This question came out of the discussion on this previous question: Creating conditional probability distribution

• What do you want to achieve with modelling this data? To what end will the analysis/model be used? – Corvus Feb 4 '13 at 17:47
• It is just a research project where people are trying to understand for example P(B,C|A). I would go on to create a number of other such probability and see if something stands out. I am trying to be rigorous as well. – user1243255 Feb 4 '13 at 17:50
• Dirichlet distributions are distributions on the simplex $\{(p_1,...,p_k);\ \sum_i p_i=1\}$ so they are certainly not appropriate for the distributions of your binary variables. It is only in a Bayesian framework that you would use Dirichlet distributions as priors on those conditional binary distributions... – Xi'an Feb 4 '13 at 21:04
• @Xi'an so binomial distribution is the correct one for this scenario? Also can you please explain: "Dirichlet distributions are distributions on the simplex .. so they are certainly not appropriate for your binary variables". – user1243255 Feb 4 '13 at 21:40

I think you might be getting a little confused about "models" and "distributions" in the context of this problem, so let's go back to basics.

There are 8 possible outcomes of each trial, depending on the combination of 3 binary outcomes, so lets label them FFF, FFT, FTF, FTT, TFF, TFT, TTF, TTT, where T=1 and F=0.

The most general possible model is to allow each outcome to have its own probability parameter, the only constraint here being that they have to add up to one. All possible dependencies are captured by this model.

So if we choose to model this using 8 parameters $(p_{FFF}, p_{FFT}, ..., p_{TTT})$ then we need a way of estimating those parameters from your data. This is very easy to do.

If you simply count up the number of each outcome you have and divide by 10,000 (the total number) then you will have a good estimate for each $p_{???}$ probability.

Now, this is of course just a statistical estimate of the true probabilities. The true probalities will be different,but we can estimate how different the are likely to be. This is where the binomial (frequentist) or dirichlet (bayesian) models come in.

Conditional Distributions

You can apply just the same method to estimate conditional probabilities. Suppose you want $P(B,C|A=1)$ then simply select only those data points where A=1. You now have 4 possible outcomes in this distribution, and you can estimate those 4 possibilities in exactly the same manner. You should notice that the 2 sets of four condional probabilities are just the 8 probabilities from above, rescaled to add up to one across each set of 4 rather than all 8.