# Compute probability that a sample is from distribution X vs Y

I have two multivariate normal distributions (say X and Y) fitted on existing data. With new data I want to compute the probability that sample is from distribution X instead of Y. It can only be one of these two distributions.

Any ideas on how I can go about doing this?

• To compute such a probability you would need a prior probability on the two. From there it's a simple application of Bayes theorem – Glen_b -Reinstate Monica Sep 10 '16 at 1:21

If the density functions of $X$ and $Y$ are $f_X$ and $f_Y$, and the prior probabilities of the data vector $d$ being drawn from distribution $X$ and $Y$ are $p_X$ and $p_Y$ respectively then the probability the data came from distribution $X$ can be found using Bayes theorem:
$$\frac{f_X(d) p_X}{f_X(d) p_X + f_Y(d) p_Y} .$$