def test_empirical_distribution(N=1000, rseed=0):
    np.random.seed(rseed)
    X = norm.rvs(0, 1, size=N)
    dist = EmpiricalDistribution(X)
    X2 = dist.rvs(N)
    meanX = X.mean()
    meanX2 = X2.mean()
    stdX = X.std()
    stdX2 = X2.std()
    assert_allclose([meanX, stdX], [meanX2, stdX2], atol=(3 / np.sqrt(N)))
def test_empirical_distribution(N=1000, rseed=0):
    np.random.seed(rseed)
    X = norm.rvs(0, 1, size=N)
    dist = EmpiricalDistribution(X)
    X2 = dist.rvs(N)
    meanX = X.mean()
    meanX2 = X2.mean()
    stdX = X.std()
    stdX2 = X2.std()
    assert_allclose([meanX, stdX], [meanX2, stdX2], atol=(3 / np.sqrt(N)))