# How to create a distribution for a feature that is conditional on more than one other variable

I have a variable, r. It has a distribution P(r). I have found two other variables, A and B that are correlated with r.

I want to build a distribution P(r) that is conditional on these two variables. I think this means I want P(r | A, B).

I want to do this because I am updating P(r) over time using Bayes rule, and I need a solid prior distribution. I know that I can use A and B to create a good prior, I just don't know how to combine them.

It has been suggested to me that I use Bayes theorem twice to get the prior I want. E.g. start with a prior, use variable A to get a posterior, set the posterior to be the prior for B, then use B to get a posterior, which is the final posterior. Is this the optimal solution?

Another idea I had was to create a new variable, C, which was a linear combination of A and B (using a linear model), then just use this. I know true mathematicians would hate this idea but maybe it would work..

Any ideas?

• What are the types of the random variables A and B? – Arya McCarthy May 7 at 15:46
• A is continuous and B is category – Christopher Collins May 7 at 15:57
• Sorry I should also add, the value of A and B are known quantities at the time I want to make the prediction. – Christopher Collins May 7 at 16:00