Ejemplo n.º 1
0
def another_simple_model():
    _model = models.simple_model()[1]
    with _model:
        pm.Potential("pot", at.ones((10, 10)))
    return _model
Ejemplo n.º 2
0
def test_accuracy_normal():
    _, model, (mu, _) = simple_model()
    with model:
        newstart = find_MAP(Point(x=[-10.5, 100.5]))
        close_to(newstart["x"], [mu, mu],
                 select_by_precision(float64=1e-5, float32=1e-4))
Ejemplo n.º 3
0
def test_logp():
    start, model, (mu, sig) = simple_model()
    lp = model.fastlogp
    lp(start)
    close_to(lp(start), sp.norm.logpdf(start["x"], mu, sig).sum(), tol)
Ejemplo n.º 4
0
def test_dlogp():
    start, model, (mu, sig) = simple_model()
    dlogp = model.fastdlogp()
    close_to(dlogp(start), -(start["x"] - mu) / sig**2, 1.0 / sig**2 / 100.0)
Ejemplo n.º 5
0
 def setup_method(self):
     _, self.model, _ = simple_model()