AllenDowney/ThinkStats2

mismatch between documentation and code in thinkstats2.Jitter

rjoberon opened this issue · 1 comments

The documentation for Jitter states Jitters the values by adding a uniform variate in (-jitter, jitter) but the code does

np.random.normal(0, jitter, n) + values

which is normal distributed data which is not necessarily (rather unlikely) in the range (-jitter, jitter).

Either the documentation should be changed or the code to

np.random.uniform(-jitter, jitter, n)

(which would also better fit the purpose in Ch. 5 to "undo" rounding)

Fixed. Thank you!