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

fix yearsets.sample_from_poisson #823

Merged
merged 1 commit into from Dec 12, 2023
Merged

Conversation

emanuel-schmid
Copy link
Collaborator

@emanuel-schmid emanuel-schmid commented Dec 4, 2023

Changes proposed in this PR:

  • skip case distinction in yearsets.sample_from_poisson

This PR fixes #819

PR Author Checklist

PR Reviewer Checklist

if lam != 1:
events_per_year = np.round(np.random.poisson(lam=lam,
size=n_sampled_years)).astype('int')
else:
events_per_year = np.ones(len(n_sampled_years))

return np.round(np.random.poisson(lam=lam, size=n_sampled_years)).astype('int')
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure to understand. This changes the behaviour of the method. Is this desired?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, exactly. The original behavior at lam = 1.0 is inconsistent, see discussion in #820.

@chahank chahank merged commit a8cb0d2 into develop Dec 12, 2023
11 checks passed
@emanuel-schmid emanuel-schmid deleted the feature/fix_sample_from_poisson branch December 13, 2023 13:26
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.

sample_from_poisson fails if lam is 1
2 participants