def test_cgcre_2(crvs):
    """
    Test that independent RVs have CGCRE = GCRE.
    """
    d = miwin()
    rv = (set([0, 1, 2]) - set(crvs)).pop()
    ccre1 = CGCRE(d, rv, crvs)
    ccre2 = CGCRE(d, rv)
    assert GCRE(d)[rv] == pytest.approx(mean(ccre1))
    assert GCRE(d)[rv] == pytest.approx(mean(ccre2))
    assert standard_deviation(ccre1) == pytest.approx(0)
Beispiel #2
0
def test_ccre_1(crvs):
    """
    Test that independent RVs have CCRE = CRE.
    """
    d = miwin()
    rv = ({0, 1, 2} - set(crvs)).pop()
    ccre1 = CCRE(d, rv, crvs)
    ccre2 = CCRE(d, rv)
    assert CRE(d)[rv] == pytest.approx(mean(ccre1))
    assert CRE(d)[rv] == pytest.approx(mean(ccre2))
    assert standard_deviation(ccre1) == pytest.approx(0)
def test_cgcre_2(crvs):
    """
    Test that independent RVs have CGCRE = GCRE.
    """
    d = miwin()
    rv = (set([0, 1, 2]) - set(crvs)).pop()
    ccre1 = CGCRE(d, rv, crvs)
    ccre2 = CGCRE(d, rv)
    assert GCRE(d)[rv] == pytest.approx(mean(ccre1))
    assert GCRE(d)[rv] == pytest.approx(mean(ccre2))
    assert standard_deviation(ccre1) == pytest.approx(0)
Beispiel #4
0
def test_cgcre_2():
    """
    Test that independent RVs have CGCRE = GCRE.
    """
    d = miwin()
    for crvs in combinations([0, 1, 2], 2):
        rv = (set([0, 1, 2]) - set(crvs)).pop()
        ccre1 = CGCRE(d, rv, crvs)
        ccre2 = CGCRE(d, rv)
        yield assert_almost_equal, GCRE(d)[rv], mean(ccre1)
        yield assert_almost_equal, GCRE(d)[rv], mean(ccre2)
        yield assert_almost_equal, standard_deviation(ccre1), 0
def test_ccre_1():
    """
    Test that independent RVs have CCRE = CRE.
    """
    d = miwin()
    for crvs in combinations([0, 1, 2], 2):
        rv = (set([0, 1, 2]) - set(crvs)).pop()
        ccre1 = CCRE(d, rv, crvs)
        ccre2 = CCRE(d, rv)
        yield assert_almost_equal, CRE(d)[rv], mean(ccre1)
        yield assert_almost_equal, CRE(d)[rv], mean(ccre2)
        yield assert_almost_equal, standard_deviation(ccre1), 0