pypolyagamma
pypolyagamma copied to clipboard
Code fails to raise error when user specifies a non-positive real number for the first parameter `b`
For example:
from pypolyagamma import PyPolyaGamma
pg = PyPolyaGamma()
b,c = -2, -1
values=[pg.pgdraw(b, c) for i in range(10000)]
assert all([x==0 for x in values])
The sampler returns all 0's, although one would expect it to raise an error.
I would have opened a PR myself, but I do not know how to code in C.