@@ -154,6 +154,8 @@ def fn(a=UNSET):
154154 # (pm.Exponential, 0, 1, {"lam": 1}, {}), PyMC Exponential gradient is failing miserably, need to figure out why
155155 (pm .HalfNormal , 0 , 1 , {"sigma" : 1 }, {}),
156156 (pm .Binomial , 0 , 8 , {"p" : 0.5 }, {"n" : 10 }),
157+ (pm .Poisson , 1 , 15 , {"mu" : 10 }, {}),
158+ (pm .Poisson , 19 , 41 , {"mu" : 30 }, {}),
157159 ],
158160)
159161@pytest .mark .parametrize ("mass" , [0.5 , 0.75 , 0.95 ])
@@ -185,26 +187,6 @@ def test_find_constrained_prior(distribution, lower, upper, init_guess, fixed_pa
185187 (19 , 41 , {"mu" : 30 }),
186188 ],
187189)
188- def test_constrained_prior_poisson (lower , upper , init_guess ):
189- distribution = pm .Poisson
190- mass = 0.95
191- with pytest .warns (None ) as record :
192- opt_params = pm .find_constrained_prior (
193- distribution ,
194- lower = lower ,
195- upper = upper ,
196- init_guess = init_guess ,
197- )
198- assert len (record ) == 0
199-
200- opt_distribution = distribution .dist (** opt_params )
201- mass_in_interval = (
202- pm .math .exp (pm .logcdf (opt_distribution , upper ))
203- - pm .math .exp (pm .logcdf (opt_distribution , lower ))
204- ).eval ()
205- assert np .abs (mass_in_interval - mass ) <= 1e-2 # reduce to 1% tolerance for float32
206-
207-
208190@pytest .mark .parametrize (
209191 "distribution, lower, upper, init_guess, fixed_params" ,
210192 [
0 commit comments