Beispiel #1
0
def test_rosenbluth_symmetry():
    data = datasets.make_uniform(seed=42, size=300, mu=1, nbin=None)
    y = data.data["x"].tolist()
    np.random.shuffle(y)
    df2 = pd.DataFrame({"x": y})
    dr2 = ApodeData(df2, income_column="x")
    assert data.concentration(method="rosenbluth") == dr2.concentration(
        method="rosenbluth")
Beispiel #2
0
def test_concentration_ratio_symmetry():
    ad = datasets.make_uniform(seed=42, size=300, mu=1, nbin=None)
    y = ad.data["x"].tolist()
    np.random.shuffle(y)
    df2 = pd.DataFrame({"x": y})
    ad2 = ApodeData(df2, income_column="x")
    assert ad.concentration(method="concentration_ratio",
                            k=20) == ad2.concentration(
                                method="concentration_ratio", k=20)