Esempio n. 1
0
    def test_prob_coal2(self):

        outdir = 'test/tmp/test_coal/Coal_test_prob_coal2/'
        make_clean_dir(outdir)

        k = 2
        n = 1000
        p = Gnuplot()
        p.enableOutput(False)
        p.plotfunc(lambda t: coal.prob_coal(t, k, n), 0, 4000, 10,
                   ymin=0)

        # draw single coal samples
        x = [coal.sample_coal(k, n) for i in xrange(200)]
        plotdistrib(x, 40, plot=p)
        p.enableOutput(True)
        p.save(outdir + 'plot.png')

        eq_sample_pdf(x, lambda t: coal.prob_coal(t, k, n), 40)
Esempio n. 2
0
    def test_plot_bounded_coal(self):
        n = 1000
        k = 6
        T = 500

        # plots should differ
        p = plotfunc(lambda t: coal.prob_bounded_coal(t, k, n, T),
                     0, 1000, 10)
        p.plotfunc(lambda t: coal.prob_coal(t, k, n),
                   0, 1000, 10)