-
Notifications
You must be signed in to change notification settings - Fork 419
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
logpdf(Binomial(0,0), x=0) returns NaN instead of 0 when x is Int32 or lower #1397
Comments
I believe this will be fixed by JuliaStats/StatsFuns.jl#113. |
This is also fixed by JuliaStats/StatsFuns.jl#125 (BTW would be great if you can find time for a review @andreasnoack - otherwise, if you are busy maybe someone else could review it?): julia> logpdf(Binomial(0, 0.), 0) # = 0.00
0.0
julia> logpdf(Binomial(0, 0.), 0.) # = 0.00
0.0
julia> logpdf(Binomial(0, 0.), Int32(0)) # = NaN
0.0
julia> logpdf(Binomial(0, 0.), Int16(0)) # = NaN
0.0
julia> logpdf(Binomial(0, 0.), Float32(0)) # = NaN
0.0
julia> logpdf(Binomial(0, 0.), Float16(0)) # = NaN
0.0 |
Thank you both. Do you have a timeline of when those will be implemented/fixed? For context, its one term in the likelihood of a chain-binomial simulation. So it represents the probability that no events occur when there are no events that can occur (which is 1) which is a valid situation in the model of interest. |
As a temporary workaround you can install JuliaStats/StatsFuns.jl#125 manually by running ] add StatsFuns#dw/rmath_real+julia_logpdf in the Julia REPL. Unfortunately, the PR is missing a more detailed review (should work fine though) and it is difficult to estimate when it will be approved, merged, and released. |
The issue will be fixed in StatsFuns 0.9.11 which will be available when JuliaRegistries/General#45672 is merged. Once it is available you should revert the manual installation suggested in the last comment (run |
The text was updated successfully, but these errors were encountered: