Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Sequence.generate_random_poisson and update Sequence.generate_random_exponential #108

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

YannickJadoul
Copy link
Collaborator

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's exponential random function. The scale parameter of that function equals the inverse of the typical lambda 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 and scale), explicitly check that users provide exactly one, and correctly pass either one to NumPy. @Jellevanderwerff, thoughts?

…exponential to correctly process lambda parameter, and update Sequence.generate_random_exponential to include a reference to Poisson point processes and Poisson distributions
@YannickJadoul
Copy link
Collaborator Author

Please also take a good look at whether the new docs are readable, thanks!

Copy link
Owner

@Jellevanderwerff Jellevanderwerff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!!

@Jellevanderwerff Jellevanderwerff merged commit 2b92dd9 into main Jan 20, 2025
35 checks passed
@Jellevanderwerff Jellevanderwerff deleted the random-poisson branch January 20, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sequence.generate_random_poisson does not generate IOIs
2 participants