Ejemplo n.º 1
0
def test_bx2_with_parts():
    np.random.seed(0)
    data = np.random.randn(10000)
    shifted = data + 3.
    data = np.append(data, [shifted])
    g1 = Extended(rename(gaussian, ['x', 'lmu', 'lsigma']), extname='N1')
    g2 = Extended(rename(gaussian, ['x', 'rmu', 'rsigma']), extname='N2')
    allpdf = AddPdf(g1, g2)
    bx2 = BinnedChi2(allpdf, data)
    bx2.draw(args=(0, 1, 10000, 3, 1, 10000), parts=True)
Ejemplo n.º 2
0
def test_bx2_with_parts():
    np.random.seed(0)
    data = np.random.randn(10000)
    shifted = data + 3.0
    data = np.append(data, [shifted])
    g1 = Extended(rename(gaussian, ["x", "lmu", "lsigma"]), extname="N1")
    g2 = Extended(rename(gaussian, ["x", "rmu", "rsigma"]), extname="N2")
    allpdf = AddPdf(g1, g2)
    bx2 = BinnedChi2(allpdf, data)
    bx2.draw(args=(0, 1, 10000, 3, 1, 10000), parts=True)
Ejemplo n.º 3
0
def test_draw_compare_hist_no_norm():
    np.random.seed(0)
    data = np.random.randn(10000)
    f = Extended(gaussian)
    draw_compare_hist(f, {
        'mean': 0.,
        'sigma': 1.,
        'N': 10000
    },
                      data,
                      normed=False)
Ejemplo n.º 4
0
def test_draw_ulh_extend():
    np.random.seed(0)
    data = np.random.randn(1000)
    ulh = UnbinnedLH(Extended(gaussian), data, extended=True)
    ulh.draw(args=(0., 1., 1000))
Ejemplo n.º 5
0
def test_draw_bx2():
    np.random.seed(0)
    data = np.random.randn(1000)
    blh = BinnedChi2(Extended(gaussian), data)
    blh.draw(args=(0., 1., 1000))
Ejemplo n.º 6
0
def test_draw_blh_extend_residual_norm():
    np.random.seed(0)
    data = np.random.randn(1000)
    blh = BinnedLH(Extended(gaussian), data, extended=True)
    blh.draw_residual(args=(0., 1., 1000), norm=True)
Ejemplo n.º 7
0
def test_draw_ulh_extend_residual_norm():
    np.random.seed(0)
    data = np.random.randn(1000)
    ulh = UnbinnedLH(Extended(gaussian), data, extended=True)
    ulh.draw_residual(args=(0., 1., 1000), norm=True)
    plt.ylim(-7.,3.)
Ejemplo n.º 8
0
def test_draw_compare_hist_no_norm():
    np.random.seed(0)
    data = np.random.randn(10000)
    f = Extended(gaussian)
    draw_compare_hist(f, {"mean": 0.0, "sigma": 1.0, "N": 10000}, data, normed=False)
Ejemplo n.º 9
0
def test_draw_blh_extend():
    np.random.seed(0)
    data = np.random.randn(1000)
    blh = BinnedLH(Extended(gaussian), data, extended=True)
    blh.draw(args=(0.0, 1.0, 1000))