Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mikewojnowicz opened this issue Feb 20, 2021 · 1 comment

Comments

@mikewojnowicz
Copy link

mikewojnowicz commented Feb 20, 2021

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.

@slinderman
Copy link
Owner

Good catch! I think you can add an assert in pgdrawv before the C code gets called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants