PoonLab / OpenRDP

An open-source re-implementation of the RDP4 recombination detection program
GNU General Public License v3.0
45 stars 9 forks source link

Divide by zero encountered in unit tests #78

Open ArtPoon opened 3 months ago

ArtPoon commented 3 months ago
(venv) art@Wernstrom OpenRDP % python -m unittest
/Users/art/git/OpenRDP/openrdp/bootscan.py:277: RuntimeWarning: divide by zero encountered in log
  (log_n_fact - (log_i_fact + log_ni_fact)) + np.log(p ** n) + np.log((1 - p) ** (n - i)))
/Users/art/git/OpenRDP/openrdp/bootscan.py:277: RuntimeWarning: divide by zero encountered in log
  (log_n_fact - (log_i_fact + log_ni_fact)) + np.log(p ** n) + np.log((1 - p) ** (n - i)))
ArtPoon commented 3 months ago

My guess is that this is an edge case where p=1 so that (1-p) ** (n-i) becomes a divide by zero error for i > n

ArtPoon commented 4 weeks ago

Seems like this is a stochastic error, which will be more difficult to diagnose...

ArtPoon commented 3 weeks ago

See also #93