pypolyagamma icon indicating copy to clipboard operation
pypolyagamma copied to clipboard

Code fails to raise error when user specifies a non-positive real number for the first parameter `b`

Open mikewojnowicz opened this issue 3 years ago • 1 comments

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.

mikewojnowicz avatar Feb 20 '21 03:02 mikewojnowicz