Skip to content

Commit

Permalink
Merge branch 'master' into dw/binom_special
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Sep 29, 2021
2 parents 906e8af + e3fe89d commit 7f08d4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ end
end
end

# https://github.com/JuliaStats/StatsFuns.jl/issues/115
@testset "support of binomial distribution" begin
@test iszero(binompdf(1, 0.5, prevfloat(1.0)))
@test iszero(binompdf(1, 0.5, nextfloat(1.0)))
@test binomlogpdf(1, 0.5, prevfloat(1.0)) == -Inf
@test binomlogpdf(1, 0.5, nextfloat(1.0)) == -Inf
end

@testset "binom special cases" begin
for (n, p, k) in ((5, 0.0, 0), (5, 1.0, 5))
@test iszero(binomlogpdf(n, p, k))
Expand Down

0 comments on commit 7f08d4f

Please sign in to comment.