0
$\begingroup$

I have 2 normal probability distributions, A and B. If random values were to be chosen from each, what's the probability that the value from A will be greater than the value from B? How can I calculate that knowing the means and std of each distribution, or conceptually from the areas under the curves:

enter image description here

$\endgroup$

migrated from stackoverflow.com Apr 25 at 20:53

This question came from our site for professional and enthusiast programmers.

2
$\begingroup$

Assuming independence (because in the case of dependence, you should provide the joint PDF), linear combinations of normal RVs are still normal. So, $A-B$ will be a normal RV. Then, we have $P(A>B)=P(A-B>0)$. In order to calculate this probability we need to know the mean and the variance of $C=A-B$. And, it is: $$\mu_c=E[C]=E[A-B]=\mu_a-\mu_b$$ $$\sigma_C^2=\operatorname{var}(C)=\operatorname{var}(A-B)=\operatorname{var}(A)+\operatorname{var}(B)=\sigma_A^2+\sigma_B^2$$

Then, you'll have the following probability: $$P(C>0)=P\left(\frac{C-\mu_c}{\sigma_c}>\frac{0-\mu_c}{\sigma_c}\right)=P\left(Z>\frac{0-\mu_c}{\sigma_c}\right)$$ Where you can use a Z-table to figure out the approximate probability.

$\endgroup$
  • $\begingroup$ Thanks. So I take it that there's no intuitive way to visual this using the probability distributions in the figure and simple integrals? Are there any statistical tests that have all the nitty gritty built in so I just enter the means and std of each distribution? In Matlab, SAS, SPSS, etc? $\endgroup$ – MikeD Apr 26 at 0:38
  • $\begingroup$ There are no simple integrals to calculate CDF of normals, which is why we have numeric Z tables. Common statistical tests (like t-test, f-test etc.) are data-driven and for deciding if the two samples differ by mean/std or not, they don't calculate $P(A>B)$. $\endgroup$ – gunes Apr 26 at 12:07
0
$\begingroup$

To add the case for dependent RVs: As pointed out in gunes' answer, you'll need the joint pdf of A and B. When plotted on a plane (A along the x-axis, B along y), A>B is the part below the diagonal through the first (and fourth) quadrant. I'm not sure if the corresponding probability can be computed analytically, but numerical integration over this area will do the job.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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