Commit 41f0b78c authored by Raymond Hettinger's avatar Raymond Hettinger Committed by Miss Islington (bot)

Simplify overlap() formula for case where variances are equal (GH-12323)

parent 31913915
......@@ -773,7 +773,7 @@ class NormalDist:
dv = Y_var - X_var
dm = fabs(Y.mu - X.mu)
if not dv:
return 2.0 * NormalDist(dm, 2.0 * X.sigma).cdf(0)
return 1.0 - erf(dm / (2.0 * X.sigma * sqrt(2.0)))
a = X.mu * Y_var - Y.mu * X_var
b = X.sigma * Y.sigma * sqrt(dm**2.0 + dv * log(Y_var / X_var))
x1 = (a + b) / dv
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment