Skip to content

Commit

Permalink
remove overflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs committed Aug 6, 2024
1 parent 5ee9afa commit 6b7ac06
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions EpiAware/test/EpiObsModels/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,3 @@ end
delay_int, time_horizon; partial = false)
@test K == expected_K
end

@testitem "Check overflow safety of Negative Binomial sampling" begin
using Distributions
big_mu = 1e30
alpha = 0.5
big_alpha = 1e30

ex_σ² = (alpha * big_mu^2)
p = big_mu / (big_mu + ex_σ²)
r = big_mu^2 / ex_σ²

#Direct definition
nb = NegativeBinomial(r, p)

@test_throws InexactError rand(nb) #Throws error due to overflow

#Safe versions
@test rand(EpiAware.EpiObsModels.NegativeBinomialMeanClust(big_mu, alpha)) isa Int
@test rand(EpiAware.EpiObsModels.NegativeBinomialMeanClust(big_mu, big_alpha)) isa Int
end

0 comments on commit 6b7ac06

Please sign in to comment.