We are given two normal populations A & B with means $\mu_1$, $\mu_2$ and standard deviations of $\sigma_1$, $\sigma_2$ respectively, as well as a subject X. Our purpose is to determine which population X is more likely to belong assuming that each population is equally likely to occur. The obvious place to start is to calculate a z-score and corresponding percentiles.

Let's say the z-score for X in regard to population A is :

$A_X = 1.3 \space\space \Rightarrow \space\space 90.32 \space$ (percentile)

And for population B, we have:

$B_X = -2.1 \space\space \Rightarrow \space\space 1.79 \space$ (percentile)

What is the proper method for quantifying which population X would most likely belong to?

  1. Should we simply reference the absolute distance from the mean? (IMO, this is very dissatisfying)
  2. Is it correct in saying that if X was from A, there would be a $\approx 5.4$ times greater chance in encountering a more extreme value than if the X was from B $(1 - 0.9032 = 0.0968 \space\space \Rightarrow \space\space \frac{0.0968}{0.0179} \approx 5.4)$?
  • 2
    $\begingroup$ You are implicitly assuming that A and B are equally likely to occur, is this on purpose? If not, this "prior probability" is an important variable in your calculation $\endgroup$
    – Sam
    Aug 30, 2017 at 15:27
  • $\begingroup$ @Sam yes,I am assuming that A and B are equally likely to occur on purpose, $\endgroup$ Aug 30, 2017 at 15:31

1 Answer 1


One way to get a probability for this is by using Bayes rule. What you want is $P(A|X)$ and $P(B|X)$.

For probabilities, the following holds: $P(A|X) = P(X| A) P(A) / P(X)$

$P(X|A)$ is the probability of X occurring if X belongs to A - so you can calculate that from the probability density function of the normal distribution with mean $\mu_1$ and variance $\sigma_1^2$.

So e.g. in R, you'd just calculate dnorm(X, mu, sigma)

$p(A)$ is your prior probability, so 0.5

and $p(X) = p(X | A) p(A) + p(X | B) p(B)$ is your "normalizing constant", which ensures that your output is still a probability.

So let's say $P(X | A) = 0.9$ and $P(X | B) = 0.3$ (these are probability densities, so they don't have to add up to 1)

then $P(X | A) p(A) = 0.9 * 0.5$ and $P(X | B) p(B) = 0.3 * 0.5$, so $p(X) = 0.6$ and hence $p(A | X) = \frac{0.45}{0.6} = 3/4$

The reason why you take the probability density, rather than the cumulative density ("percentile"), is easy to illustrate in the multimodal case:

Let's assume that A is a multimodal Gaussian

Histogram for multimodal Gaussian samples with means at -2 and 2

Let's say your you want to get $p(X = 0.5 | A)$. If you take the percentile, it would tell you it's about 50% - However as you can see, the probability of it occurring is very small. What you want for $p(X|A)$ is really the relative likelihood of occurrence, which is given by the probability density value (on the y-axis)

  • $\begingroup$ Nice answer. Wouldn't P(X|A) simply be the percentile (i.e. .9032)? E.g. in R we have pnorm(X, mean = mu1, sd = sigma1 = 0.9031995, where mu1 and sigma1 are from the question. $\endgroup$ Aug 30, 2017 at 16:23
  • $\begingroup$ added a comment about that $\endgroup$
    – Sam
    Aug 30, 2017 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.