Example #1
0
    def test_coal(self):

        a = 5
        b = 2
        t = 2.0
        n = 1.0

        for i in range(10):
            x = coal.sample_coal_cond_counts(a, b, t, n)
Example #2
0
    def test_sample_coal_cond_counts(self):

        # test coalescent pdf when conditioned on future lineage counts

        a = 5
        for b in xrange(2, a):
            t = 500
            n = 1000

            # draw single coal samples using rejection sampling
            s = [coal.sample_coal_cond_counts(a, b, t, n)
                 for i in xrange(1000)]

            eq_sample_pdf(s, lambda x: coal.prob_coal_cond_counts(
                x, a, b, t, n), 40)