Skip to content

Commit 8484ced

Browse files
authored
Merge pull request #280 from hyanwong/log0
Avoid warnings for log(0)
2 parents 6fbe595 + 6041c61 commit 8484ced

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)