Skip to content

Commit

Permalink
FIX: rank-size test by inc. sample size (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
bktaha committed Jul 1, 2020
1 parent 082e960 commit b993db8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions quantecon/tests/test_inequality.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def test_rank_size():
of the size of the distribution.
"""

sample_size = 1000
np.random.seed(15)
sample_size = 10000
c = 0.74

# Tests Pareto; r_squared ~ 1
Expand All @@ -116,10 +117,9 @@ def test_rank_size():
_, _, r_value, _, _ = linregress(np.log(rank_data), np.log(size_data))
r_sqval = r_value**2

assert_allclose(r_sqval, 1, rtol=1e-4)
assert_allclose(r_sqval, 1, rtol=1e-3)

# Tests Exponential; r_squared < 1
np.random.seed(13)
z = np.random.randn(sample_size)

exp_draw = np.exp(z)
Expand All @@ -129,6 +129,5 @@ def test_rank_size():
np.log(size_data_exp))
r_sqval_exp = r_value_exp**2

assert_raises(AssertionError, assert_allclose, r_sqval_exp, 1, rtol=1e-4)

assert_raises(AssertionError, assert_allclose, r_sqval_exp, 1, rtol=1e-3)

0 comments on commit b993db8

Please sign in to comment.