-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Automatically derive icdf for negative power transforms #7956
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
Changes from all commits
c2fe0ae
1f325bd
f1b3d3c
eec79ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -687,6 +687,13 @@ def test_inverse_gamma_logcdf(self): | |
| lambda value, alpha, beta: st.invgamma.logcdf(value, alpha, scale=beta), | ||
| ) | ||
|
|
||
| def test_inverse_gamma_icdf(self): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some distributions have all functionality tests (logp, logcdf, icdf) under a single method (
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No grand plan. I prefer separate but if a function was already testing multiple for that distribution I will just append to it |
||
| check_icdf( | ||
| pm.InverseGamma, | ||
| {"alpha": Rplusbig, "beta": Rplusbig}, | ||
| lambda q, alpha, beta: st.invgamma.ppf(q, alpha, scale=beta), | ||
| ) | ||
|
|
||
| @pytest.mark.skipif( | ||
| condition=(pytensor.config.floatX == "float32"), | ||
| reason="Fails on float32 due to scaling issues", | ||
|
|
@@ -872,6 +879,12 @@ def test_logitnormal(self): | |
| ), | ||
| decimal=select_by_precision(float64=6, float32=1), | ||
| ) | ||
| check_icdf( | ||
| pm.LogitNormal, | ||
| {"mu": R, "sigma": Rplus}, | ||
| lambda q, mu, sigma: sp.expit(mu + sigma * st.norm.ppf(q)), | ||
| decimal=select_by_precision(float64=12, float32=5), | ||
| ) | ||
|
|
||
| @pytest.mark.skipif( | ||
| condition=(pytensor.config.floatX == "float32"), | ||
|
|
||
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.
I don't visualize the math on top of my head. I presume this is what
test_inverse_gamma_icdfbelow checks?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.
yes