-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add icdf functions for Inverse Gamma distribution #7917
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
base: main
Are you sure you want to change the base?
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7917 +/- ##
=======================================
Coverage 91.62% 91.63%
=======================================
Files 116 116
Lines 18852 18856 +4
=======================================
+ Hits 17274 17278 +4
Misses 1578 1578
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! @ricardoV94 do you want to check it before I snap merge?
) | ||
|
||
def icdf(value, alpha, beta): | ||
res = 1 / Gamma.icdf(value=1 - value, alpha=alpha, scale=1 / beta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use the stable API, and then you don't need to hack with the scale thing either
res = 1 / Gamma.icdf(value=1 - value, alpha=alpha, scale=1 / beta) | |
res = 1 / icdf(Gamma.dist(alpha=alhpa, beta=beta), value=1 - value) |
) | ||
|
||
def icdf(value, alpha, beta): | ||
res = 1 / Gamma.icdf(value=1 - value, alpha=alpha, scale=1 / beta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For curiosity only, any intuition why the icdf looks like it does, specially the flipped value. It's interesting
Adds ICDF functions to Inverse Gamma distribution
Description
The quantile function depends on the quantile function of Gamma distribution: #6845
Related Issue
Checklist
Type of change
📚 Documentation preview 📚: https://pymc--7917.org.readthedocs.build/en/7917/