def _logsf(self, k, M, n, N):
res = []
for quant, tot, good, draw in zip(k, M, n, N):
if (quant + 0.5) * (tot + 0.5) < (good - 0.5) * (draw - 0.5):
// Less terms to sum if we calculate log(1-cdf)
res.append(log1p(-exp(self.logcdf(quant, tot, good, draw))))
After Change
def _logsf(self, k, M, n, N):
res = []
for quant, tot, good, draw in zip(*np.broadcast_arrays(k, M, n, N)):
if (quant + 0.5) * (tot + 0.5) < (good - 0.5) * (draw - 0.5):
// Less terms to sum if we calculate log(1-cdf)
res.append(log1p(-exp(self.logcdf(quant, tot, good, draw))))