Skip to content

Commit

Permalink
increase leeway for test
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbern committed Apr 18, 2018
1 parent 38aa313 commit 99cd9ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test_convoys.py
Expand Up @@ -50,12 +50,12 @@ def test_exponential_regression_model(c=0.3, lambd=0.1, n=100000):
assert 0.70*(c_hi-c_lo) < (y_hi-y_lo) < 1.30*(c_hi-c_lo)

# Check the random variates
will_convert, convert_at = model.rvs([1], n_curves=1, n_samples=1000)
will_convert, convert_at = model.rvs([1], n_curves=1, n_samples=10000)
assert 0.95*c < numpy.mean(will_convert) < 1.05*c
convert_times = convert_at[will_convert]
for t in [1, 3, 10]:
d = 1 - numpy.exp(-lambd*t)
assert 0.9*d < (convert_times < t).mean() < 1.1*d
assert 0.8*d < (convert_times < t).mean() < 1.2*d


@flaky.flaky
Expand Down

0 comments on commit 99cd9ef

Please sign in to comment.