Jellevanderwerff / thebeat

thebeat: Rhythms in Python for science
https://thebeat.readthedocs.io
GNU General Public License v3.0
19 stars 1 forks source link

`Sequence.generate_random_poisson` does not generate IOIs #78

Open YannickJadoul opened 4 months ago

YannickJadoul commented 4 months ago

Sequence.generate_random_poisson generates a random sample of the number of events and uses it as IOIs. This does not seem to make sense, as it does not produce the time until the next sample, but just samples integers. This includes 0, which results in an error, cause 0 is not a valid IOI length.

YannickJadoul commented 4 months ago

Reproducer of the exception:

generator = np.random.default_rng(123)
seq = thebeat.Sequence.generate_random_poisson(n_events=3000,lam=7,rng=generator)