Skip to content

Refactored pymc3_random_discrete to use histograms instead of raw counts #4840

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

Merged
merged 2 commits into from
Jul 5, 2021
Merged

Refactored pymc3_random_discrete to use histograms instead of raw counts #4840

merged 2 commits into from
Jul 5, 2021

Conversation

fonnesbeck
Copy link
Member

Fixes failures due to new error checking in scipy.stats.chisquare.

Closes #4810

@fonnesbeck fonnesbeck requested a review from ricardoV94 July 4, 2021 16:29
p = 1.0
else:
_, p = st.chisquare(k[:, 0], k[:, 1])
_, p = st.chisquare(observed+1, expected+1)
Copy link
Member

Choose a reason for hiding this comment

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

What does the +1 achieve?

Copy link
Member Author

@fonnesbeck fonnesbeck Jul 4, 2021

Choose a reason for hiding this comment

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

If any of the bins are zero, the test fails (divide by zero). This was an easier solution than trying to te-generate the histogram with different bin sizes.

Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

LGTM, just needs that pre-commit fixed

@michaelosthege
Copy link
Member

/pre-commit-run

michaelosthege
michaelosthege previously approved these changes Jul 4, 2021
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.

3 participants