Beispiel #1
0
def test_rawlsian_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.welfare(method="rawlsian") == dr2.welfare(method="rawlsian")
Beispiel #2
0
def test_utilitarian_replication():
    data = datasets.make_uniform(seed=42, size=300, mu=1, nbin=None)
    k = 2  # factor
    y = k * data.data["x"].tolist()
    df2 = pd.DataFrame({"x": y})
    dr2 = ApodeData(df2, income_column="x")
    assert data.welfare("utilitarian") == dr2.welfare("utilitarian")
Beispiel #3
0
def test_theilt_replication():
    ad = datasets.make_uniform(seed=42, size=300, mu=1, nbin=None)
    k = 2  # factor
    y = k * ad.data["x"].tolist()
    df2 = pd.DataFrame({"x": y})
    ad2 = ApodeData(df2, income_column="x")
    assert ad.welfare("theilt") == ad2.welfare("theilt")
Beispiel #4
0
def test_utilitarian_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")
    np.testing.assert_allclose(data.welfare(method="utilitarian"),
                               dr2.welfare(method="utilitarian"))
Beispiel #5
0
def test_theilt_homogeneity():
    data = datasets.make_uniform(seed=42, size=300, mu=1, nbin=None)
    k = 2  # factor
    y = data.data["x"].tolist()
    y = k * y
    df2 = pd.DataFrame({"x": y})
    dr2 = ApodeData(df2, income_column="x")
    assert data.welfare("theilt") == dr2.welfare("theilt")
Beispiel #6
0
def test_utilitarian_homogeneity():
    ad = datasets.make_uniform(seed=42, size=300, mu=1, nbin=None)
    k = 2  # factor
    y = ad.data["x"].tolist()
    y = k * y
    df2 = pd.DataFrame({"x": y})
    ad2 = ApodeData(df2, income_column="x")
    assert ad.welfare("utilitarian") == ad2.welfare("utilitarian")
Beispiel #7
0
def test_theilt_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")
    np.testing.assert_allclose(ad.welfare(method="theilt"),
                               ad2.welfare(method="theilt"))