arviz-devs / preliz

A tool-box for prior elicitation.
https://preliz.readthedocs.io
Apache License 2.0
78 stars 9 forks source link

Add eficient hypergeometric #407

Closed aloctavodia closed 4 months ago

aloctavodia commented 4 months ago

This adds hypergeometric distribution. Both the cdf and ppf are computed numerically. The ppf is off by one, not sure why as all other tests are passing. In the meantime, I am handling the hypergeometric as a special case.

This also updates the find_ppf function to make it work with discrete distributions.

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 91.86992% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 81.33%. Comparing base (f659f65) to head (e949e27). Report is 11 commits behind head on main.

Files Patch % Lines
preliz/distributions/hypergeometric.py 88.76% 10 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #407 +/- ## ========================================== + Coverage 81.14% 81.33% +0.19% ========================================== Files 73 85 +12 Lines 6448 7066 +618 ========================================== + Hits 5232 5747 +515 - Misses 1216 1319 +103 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.