Example #1
0
 def test_moment(self, mu, sigma, init, steps, size, expected):
     with Model() as model:
         GaussianRandomWalk("x",
                            mu=mu,
                            sigma=sigma,
                            init=init,
                            steps=steps,
                            size=size)
     assert_moment_is_expected(model, expected)
Example #2
0
 def test_list_multivariate_components(self, weights, comp_dists, size, expected):
     with Model() as model:
         Mixture("x", weights, comp_dists, size=size)
     assert_moment_is_expected(model, expected, check_finite_logp=False)
Example #3
0
 def test_moment(self, size, expected):
     with Model() as model:
         init_dist = Constant.dist([[1.0, 2.0], [3.0, 4.0]])
         AR("x", rho=[0, 0], init_dist=init_dist, steps=5, size=size)
     assert_moment_is_expected(model, expected, check_finite_logp=False)
Example #4
0
def test_bart_moment(size, expected):
    X = np.zeros((50, 2))
    Y = np.zeros(50)
    with pm.Model() as model:
        pm.BART("x", X=X, Y=Y, size=size)
    assert_moment_is_expected(model, expected)