@@ -1115,6 +1115,25 @@ def test_ex_gaussian(self, value, mu, sigma, nu, logp):
1115
1115
pt = {'eg' : value }
1116
1116
assert_almost_equal (model .fastlogp (pt ), logp , decimal = select_by_precision (float64 = 6 , float32 = 2 ), err_msg = str (pt ))
1117
1117
1118
+ @pytest .mark .parametrize ('value,mu,sigma,nu,logcdf' , [
1119
+ (0.5 , - 50.000 , 0.500 , 0.500 , 0.0000000 ),
1120
+ (1.0 , - 1.000 , 0.001 , 0.001 , 0.0000000 ),
1121
+ (2.0 , 0.001 , 1.000 , 1.000 , - 0.2365674 ),
1122
+ (5.0 , 0.500 , 2.500 , 2.500 , - 0.2886489 ),
1123
+ (7.5 , 2.000 , 5.000 , 5.000 , - 0.5655104 ),
1124
+ (15.0 , 5.000 , 7.500 , 7.500 , - 0.4545255 ),
1125
+ (50.0 , 50.000 , 10.000 , 10.000 , - 1.433714 ),
1126
+ (1000.0 , 500.000 , 10.000 , 20.000 , - 1.573708e-11 ),
1127
+ ])
1128
+ def test_ex_gaussian_cdf (self , value , mu , sigma , nu , logcdf ):
1129
+ """Log probabilities calculated using the pexGAUS function from the R package gamlss.
1130
+ See e.g., doi: 10.1111/j.1467-9876.2005.00510.x, or http://www.gamlss.org/."""
1131
+ assert_almost_equal (
1132
+ ExGaussian .dist (mu = mu , sigma = sigma , nu = nu ).logcdf (value ).tag .test_value ,
1133
+ logcdf ,
1134
+ decimal = select_by_precision (float64 = 6 , float32 = 2 ),
1135
+ err_msg = str ((value , mu , sigma , nu , logcdf )))
1136
+
1118
1137
@pytest .mark .xfail (condition = (theano .config .floatX == "float32" ), reason = "Fails on float32" )
1119
1138
def test_vonmises (self ):
1120
1139
self .pymc3_matches_scipy (
0 commit comments