From 6b7ac0681d93a8bcc459636e073d4446744235e6 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Tue, 6 Aug 2024 16:15:20 +0100 Subject: [PATCH] remove overflow test --- EpiAware/test/EpiObsModels/utils.jl | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/EpiAware/test/EpiObsModels/utils.jl b/EpiAware/test/EpiObsModels/utils.jl index 4ed0f25a1..c9b282f12 100644 --- a/EpiAware/test/EpiObsModels/utils.jl +++ b/EpiAware/test/EpiObsModels/utils.jl @@ -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