49
49
RealMatrix ,
50
50
Rplus ,
51
51
Rplusbig ,
52
- Rplusdunif ,
53
- Runif ,
54
52
Simplex ,
55
- Unit ,
56
53
Vector ,
57
54
build_model ,
58
55
product ,
@@ -977,13 +974,6 @@ def ref_rand(size, kappa, b, mu):
977
974
978
975
pymc3_random (pm .AsymmetricLaplace , {"b" : Rplus , "kappa" : Rplus , "mu" : R }, ref_rand = ref_rand )
979
976
980
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
981
- def test_lognormal (self ):
982
- def ref_rand (size , mu , tau ):
983
- return np .exp (mu + (tau ** - 0.5 ) * st .norm .rvs (loc = 0.0 , scale = 1.0 , size = size ))
984
-
985
- pymc3_random (pm .Lognormal , {"mu" : R , "tau" : Rplusbig }, ref_rand = ref_rand )
986
-
987
977
@pytest .mark .xfail (reason = "This distribution has not been refactored for v4" )
988
978
def test_student_t (self ):
989
979
def ref_rand (size , nu , mu , lam ):
@@ -998,24 +988,6 @@ def ref_rand(size, mu, sigma, nu):
998
988
999
989
pymc3_random (pm .ExGaussian , {"mu" : R , "sigma" : Rplus , "nu" : Rplus }, ref_rand = ref_rand )
1000
990
1001
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1002
- def test_vonmises (self ):
1003
- def ref_rand (size , mu , kappa ):
1004
- x = st .vonmises .rvs (size = size , loc = mu , kappa = kappa )
1005
-
1006
- pymc3_random (pm .VonMises , {"mu" : R , "kappa" : Rplus }, ref_rand = ref_rand )
1007
-
1008
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1009
- def test_triangular (self ):
1010
- def ref_rand (size , lower , upper , c ):
1011
- scale = upper - lower
1012
- c_ = (c - lower ) / scale
1013
- return st .triang .rvs (size = size , loc = lower , scale = scale , c = c_ )
1014
-
1015
- pymc3_random (
1016
- pm .Triangular , {"lower" : Runif , "upper" : Runif + 3 , "c" : Runif + 1 }, ref_rand = ref_rand
1017
- )
1018
-
1019
991
@pytest .mark .xfail (reason = "This distribution has not been refactored for v4" )
1020
992
def test_flat (self ):
1021
993
with pm .Model ():
@@ -1043,50 +1015,6 @@ def test_beta_binomial(self):
1043
1015
def _beta_bin (self , n , alpha , beta , size = None ):
1044
1016
return st .binom .rvs (n , st .beta .rvs (a = alpha , b = beta , size = size ))
1045
1017
1046
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1047
- def test_bernoulli (self ):
1048
- pymc3_random_discrete (
1049
- pm .Bernoulli , {"p" : Unit }, ref_rand = lambda size , p = None : st .bernoulli .rvs (p , size = size )
1050
- )
1051
-
1052
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1053
- def test_poisson (self ):
1054
- pymc3_random_discrete (pm .Poisson , {"mu" : Rplusbig }, size = 500 , ref_rand = st .poisson .rvs )
1055
-
1056
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1057
- def test_negative_binomial (self ):
1058
- def ref_rand (size , alpha , mu ):
1059
- return st .nbinom .rvs (alpha , alpha / (mu + alpha ), size = size )
1060
-
1061
- pymc3_random_discrete (
1062
- pm .NegativeBinomial ,
1063
- {"mu" : Rplusbig , "alpha" : Rplusbig },
1064
- size = 100 ,
1065
- fails = 50 ,
1066
- ref_rand = ref_rand ,
1067
- )
1068
-
1069
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1070
- def test_geometric (self ):
1071
- pymc3_random_discrete (pm .Geometric , {"p" : Unit }, size = 500 , fails = 50 , ref_rand = nr .geometric )
1072
-
1073
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1074
- def test_hypergeometric (self ):
1075
- def ref_rand (size , N , k , n ):
1076
- return st .hypergeom .rvs (M = N , n = k , N = n , size = size )
1077
-
1078
- pymc3_random_discrete (
1079
- pm .HyperGeometric ,
1080
- {
1081
- "N" : Domain ([10 , 11 , 12 , 13 ], "int64" ),
1082
- "k" : Domain ([4 , 5 , 6 , 7 ], "int64" ),
1083
- "n" : Domain ([6 , 7 , 8 , 9 ], "int64" ),
1084
- },
1085
- size = 500 ,
1086
- fails = 50 ,
1087
- ref_rand = ref_rand ,
1088
- )
1089
-
1090
1018
@pytest .mark .xfail (reason = "This distribution has not been refactored for v4" )
1091
1019
def test_discrete_uniform (self ):
1092
1020
def ref_rand (size , lower , upper ):
@@ -1096,33 +1024,6 @@ def ref_rand(size, lower, upper):
1096
1024
pm .DiscreteUniform , {"lower" : - NatSmall , "upper" : NatSmall }, ref_rand = ref_rand
1097
1025
)
1098
1026
1099
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1100
- def test_discrete_weibull (self ):
1101
- def ref_rand (size , q , beta ):
1102
- u = np .random .uniform (size = size )
1103
-
1104
- return np .ceil (np .power (np .log (1 - u ) / np .log (q ), 1.0 / beta )) - 1
1105
-
1106
- pymc3_random_discrete (
1107
- pm .DiscreteWeibull , {"q" : Unit , "beta" : Rplusdunif }, ref_rand = ref_rand
1108
- )
1109
-
1110
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1111
- def test_weibull (self ):
1112
- def ref_rand (size , alpha , beta ):
1113
- u = np .random .uniform (size = size )
1114
- return beta * np .power (- np .log (u ), 1 / alpha )
1115
-
1116
- pymc3_random (pm .Weibull , {"alpha" : Rplusbig , "beta" : Rplusbig }, ref_rand = ref_rand )
1117
-
1118
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1119
- @pytest .mark .parametrize ("s" , [2 , 3 , 4 ])
1120
- def test_categorical_random (self , s ):
1121
- def ref_rand (size , p ):
1122
- return nr .choice (np .arange (p .shape [0 ]), p = p , size = size )
1123
-
1124
- pymc3_random_discrete (pm .Categorical , {"p" : Simplex (s )}, ref_rand = ref_rand )
1125
-
1126
1027
@pytest .mark .xfail (reason = "This distribution has not been refactored for v4" )
1127
1028
def test_constant_dist (self ):
1128
1029
def ref_rand (size , c ):
@@ -1339,13 +1240,6 @@ def test_dirichlet_multinomial_dist_ShapeError(self, n, a, shape, expectation):
1339
1240
with expectation :
1340
1241
m .random ()
1341
1242
1342
- @pytest .mark .skip (reason = "This test is covered by Aesara" )
1343
- def test_logistic (self ):
1344
- def ref_rand (size , mu , s ):
1345
- return st .logistic .rvs (loc = mu , scale = s , size = size )
1346
-
1347
- pymc3_random (pm .Logistic , {"mu" : R , "s" : Rplus }, ref_rand = ref_rand )
1348
-
1349
1243
@pytest .mark .xfail (reason = "This distribution has not been refactored for v4" )
1350
1244
def test_logitnormal (self ):
1351
1245
def ref_rand (size , mu , sigma ):
0 commit comments