I'm attempting to calculate the probability that normal distribution A is greater than normal distribution B, given the following:
A ~ N(mu1, var1)
B ~ N(mu2, var2)
So far, my attempt has been as follows:
- Find the intersections of the two normal distributions to get x1 (upper intersect) and x2 (lower intersect)
- Calculate the probability within the interval of x1 and x2 for distribution A by: areaA <- pnorm(x1, mean(A), sd(A)) - pnorm(x2, mean(A), sd(A))
- Calculate the probability within the interval of x1 and x2 for distribution B by: areaB <- pnorm(x1, mean(B), sd(B)) - pnorm(x2, mean(B), sd(B))
- Subtract areaB from areaA to get the probability of A > B
Does this logic make sense? Is there any easier way to do this than the way I've done it?
Thanks!