I am looking to find the overlapping probability of two normal distributions in Python. I've looked around on stackoverflow and found the following:
Overlapping probability of two normal distribution with scipy
The code by "amitdatta" seems to give a syntax error and has lower and upper variables undefined.
The error that occurs is overlap = (norm.cdf(r1,m1,std1)-norm.cdf(lower,m1,std1))+(norm.cdf(r2,m2,std2)-norm.cdf(r1,m2,std2))+(norm.cdf(upper,m1,std1)-norm.cdf(r2,m1,std1))
^
SyntaxError: invalid syntax
(The syntax error arrow points to the second "r2" in the code)
Can anyone point me to code or advise me on finding the overlapping probability of two normal distributions?
Thanks!
Version: Python 3.6.2