Skip to content

Commit 6041c61

Browse files
committed
Avoid warnings for log(0)
1 parent d9a020f commit 6041c61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tsdate/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def logsumexp(X):
406406
r *= np.exp(alpha - x)
407407
r += 1.0
408408
alpha = x
409-
return np.log(r) + alpha
409+
return -np.Inf if r == 0 else np.log(r) + alpha
410410

411411
@staticmethod
412412
def _lik(muts, span, dt, mutation_rate, standardize=True):

0 commit comments

Comments
 (0)