Remove Sequence.generate_random_poisson
and update Sequence.generate_random_exponential
#108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #78.
Poisson distributions are not continuous distributions, and they have a non-zero probability for the integer 0. As such, they are an invalid way of sampling random IOIs for a sequence. As such, this PR removes the
Sequence.generate_random_poisson
class method.The random sequences relevant in the context of a Poisson process/distribution were already generated by
Sequence.generate_random_exponential
. That docstring is also updated so that users can still find relevant information regarding "Poisson" in the documentation.However, the
lam
parameter was passed incorrectly to NumPy'sexponential
random function. Thescale
parameter of that function equals the inverse of the typicallambda
parametrization of the exponential distribution and Poisson distribution. I.e., lambda corresponds to the rate/frequency, scale corresponds to the mean interval duration.This PR also fixes that, but brings up the question which parametrization we want to provide? The "maths one" or the "NumPy one"? Alternatively, we could also provide 2 optional parameters (
lam
andscale
), explicitly check that users provide exactly one, and correctly pass either one to NumPy. @Jellevanderwerff, thoughts?