@@ -580,8 +580,8 @@ def check_logp(
580
580
n_samples : Int
581
581
Upper limit on the number of valid domain and value combinations that
582
582
are compared between pymc3 and scipy methods. If n_samples is below the
583
- total number of combinations, a random subset is evaluated.
584
- Defaults to 100
583
+ total number of combinations, a random subset is evaluated. Setting
584
+ n_samples = -1, will return all possible combinations. Defaults to 100
585
585
extra_args : Dictionary with extra arguments needed to build pymc3 model
586
586
Dictionary is passed to helper function `build_model` from which
587
587
the pymc3 distribution logp is calculated
@@ -657,8 +657,8 @@ def check_logcdf(
657
657
n_samples : Int
658
658
Upper limit on the number of valid domain and value combinations that
659
659
are compared between pymc3 and scipy methods. If n_samples is below the
660
- total number of combinations, a random subset is evaluated.
661
- Defaults to 100
660
+ total number of combinations, a random subset is evaluated. Setting
661
+ n_samples = -1, will return all possible combinations. Defaults to 100
662
662
skip_paramdomain_inside_edge_test : Bool
663
663
Whether to run test 1., which checks that pymc3 and scipy distributions
664
664
match for valid values and parameters inside the respective domain edges
@@ -1205,7 +1205,7 @@ def test_half_cauchy(self):
1205
1205
lambda value , beta : sp .halfcauchy .logcdf (value , scale = beta ),
1206
1206
)
1207
1207
1208
- def test_gamma (self ):
1208
+ def test_gamma_logp (self ):
1209
1209
self .check_logp (
1210
1210
Gamma ,
1211
1211
Rplus ,
@@ -1216,11 +1216,21 @@ def test_gamma(self):
1216
1216
def test_fun (value , mu , sigma ):
1217
1217
return sp .gamma .logpdf (value , mu ** 2 / sigma ** 2 , scale = 1.0 / (mu / sigma ** 2 ))
1218
1218
1219
- self .check_logp (Gamma , Rplus , {"mu" : Rplusbig , "sigma" : Rplusbig }, test_fun )
1219
+ self .check_logp (
1220
+ Gamma ,
1221
+ Rplus ,
1222
+ {"mu" : Rplusbig , "sigma" : Rplusbig },
1223
+ test_fun ,
1224
+ )
1220
1225
1226
+ @pytest .mark .xfail (
1227
+ condition = (theano .config .floatX == "float32" ),
1228
+ reason = "Fails on float32 due to numerical issues" ,
1229
+ )
1230
+ def test_gamma_logcdf (self ):
1221
1231
# pymc-devs/Theano-PyMC#224: skip_paramdomain_outside_edge_test has to be set
1222
1232
# True to avoid triggering a C-level assertion in the Theano GammaQ function
1223
- # in gamma.c file. Can be set back to False (defalut ) once that issue is solved
1233
+ # in gamma.c file. Can be set back to False (default ) once that issue is solved
1224
1234
self .check_logcdf (
1225
1235
Gamma ,
1226
1236
Rplus ,
@@ -1242,7 +1252,7 @@ def test_inverse_gamma(self):
1242
1252
)
1243
1253
# pymc-devs/Theano-PyMC#224: skip_paramdomain_outside_edge_test has to be set
1244
1254
# True to avoid triggering a C-level assertion in the Theano GammaQ function
1245
- # in gamma.c file. Can be set back to False (defalut ) once that issue is solved
1255
+ # in gamma.c file. Can be set back to False (default ) once that issue is solved
1246
1256
self .check_logcdf (
1247
1257
InverseGamma ,
1248
1258
Rplus ,
0 commit comments