1
- from checks import *
2
- from models import simple_model , mv_simple
1
+ from . checks import *
2
+ from . models import simple_model , mv_simple
3
3
from theano .tensor import constant
4
4
from scipy .stats .mstats import moment
5
5
@@ -11,26 +11,23 @@ def check_stat(name, trace, var, stat, value, bound):
11
11
def test_step_continuous ():
12
12
start , model , (mu , C ) = mv_simple ()
13
13
14
- hmc = pm .HamiltonianMC (model .vars , C , is_cov = True , model = model )
15
- mh = pm .Metropolis (model .vars , C , is_cov = True , scaling = 2 , model = model )
14
+ hmc = pm .HamiltonianMC (model .vars , C , is_cov = True , model = model )
15
+ mh = pm .Metropolis (model .vars , model = model )
16
+ slicer = pm .Slice (model .vars , model = model )
16
17
compound = pm .CompoundStep ([hmc , mh ])
17
18
18
- steps = [mh , hmc , compound ]
19
+ steps = [mh , hmc , compound , slicer ]
20
+
19
21
20
22
unc = np .diag (C )** .5
21
23
check = [('x' , np .mean , mu , unc / 10. ),
22
24
('x' , np .std , unc , unc / 10. )]
23
25
24
26
for st in steps :
25
27
np .random .seed (1 )
26
- h = sample (8000 , st , start , track_progress = False , model = model )
28
+ h = sample (8000 , st , start , model = model )
27
29
for (var , stat , val , bound ) in check :
28
30
np .random .seed (1 )
29
- h = sample (8000 , st , start , track_progess = False , model = model )
30
-
31
- yield check_stat ,repr (st ), h , var , stat , val , bound
32
-
33
-
34
-
35
-
31
+ h = sample (8000 , st , start , model = model )
36
32
33
+ yield check_stat ,repr (st ), h , var , stat , val , bound
0 commit comments