def test_cost_lnprob(self): t = np.arange(0, 1, 0.005) X = t - 3 Y = t * t - 1. / (t + 1) like = KurslMethod.cost_lnprob(X, Y) expected_like, eps = -459.6, 1e-1 self.assertTrue( abs(like - expected_like) < eps, "Expected likelihood ({} +- {}), but got {}".format( expected_like, eps, like))
def test_cost_lnprob_same(self): X = np.random.random(100) Y = X.copy() like = KurslMethod.cost_lnprob(X, Y) self.assertEqual(like, 0, "Same processes produce 0 lnprob")
def test_cost_lnprob_zeros(self): (X, Y) = np.zeros((2, 100)) like = KurslMethod.cost_lnprob(X, Y) self.assertEqual(like, 0)