File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 18
18
19
19
from pymc3 .step_methods .metropolis import tune
20
20
from pymc3 .tests import models
21
+ from pymc3 .tests .helpers import select_by_precision
21
22
from pymc3 .tuning import find_MAP , scaling
22
23
23
24
@@ -36,18 +37,16 @@ def test_guess_scaling():
36
37
def test_mle_jacobian ():
37
38
"""Test MAP / MLE estimation for distributions with flat priors."""
38
39
truth = 10.0 # Simple normal model should give mu=10.0
40
+ rtol = select_by_precision (float64 = 1e-6 , float32 = 1e-4 )
39
41
40
42
start , model , _ = models .simple_normal (bounded_prior = False )
41
43
with model :
42
44
map_estimate = find_MAP (method = "BFGS" , model = model )
43
-
44
- rtol = 1e-5 # this rtol should work on both floatX precisions
45
45
np .testing .assert_allclose (map_estimate ["mu_i" ], truth , rtol = rtol )
46
46
47
47
start , model , _ = models .simple_normal (bounded_prior = True )
48
48
with model :
49
49
map_estimate = find_MAP (method = "BFGS" , model = model )
50
-
51
50
np .testing .assert_allclose (map_estimate ["mu_i" ], truth , rtol = rtol )
52
51
53
52
You can’t perform that action at this time.
0 commit comments