Ejemplo n.º 1
0
 def test_lnprob(self):
     t = np.arange(0, 1, 0.01)
     S = np.random.random(t.size)
     theta = self.random_theta(4, 3)
     kursl = KurSL(theta)
     model = ModelWrapper(kursl)
     self.assertTrue(
         KurslMCMC.lnprob(theta, t, S[:-1], model) < 0,
         "Any good theta should return negative value")
Ejemplo n.º 2
0
    def test_lnprob_theta_outside_range(self):
        t = np.arange(0, 1, 0.01)
        S = np.random.random(t.size)
        theta = self.random_theta(4, 3)
        kursl = KurSL(theta)
        model = ModelWrapper(kursl)

        theta[0, 0] = model.MIN_W - 1
        self.assertEqual(KurslMCMC.lnprob(theta, t, S[:-1], model), -np.inf,
                         "Inherit behaviour of lnprob and lnlikelihood")