hildensia/bayesian_changepoint_detection

'FloatingPointError: underflow encountered in logaddexp' occurs when setting np.seterr(all='raise')

alatif-alatif opened this issue · 0 comments

Hi,

I installed bayesian_changepoint_detection from this github repository.

By setting (accidentally) np.seterr(all='raise'), I was able to cause the following exception.

I am not sure whether this would have any relevance for the further processing, but I just wanted to draw attention to people working on / with this library.

/home/user/venv/env01/bin/python3.6 /home/user/PycharmProjects/project01/snippet.py
Use scipy logsumexp().
Traceback (most recent call last):
  File "/home/user/PycharmProjects/project01/snippet.py", line 68, in <module>
    Q, P, Pcp = offcd.offline_changepoint_detection(data, partial(offcd.const_prior, l=(len(data) + 1)), offcd.gaussian_obs_log_likelihood, truncate=-40)
  File "/home/user/experiments/original-unforked/bayesian_changepoint_detection/bayesian_changepoint_detection/offline_changepoint_detection.py", line 98, in offline_changepoint_detection
    Q[t] = np.logaddexp(P_next_cp, P[t, n-1] + antiG)
FloatingPointError: underflow encountered in logaddexp

Process finished with exit code 1