Skip to content

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Nov 8, 2025

(* non even powers)

This way we get icdf easily for InverseGamma and LogitNormal. I removed the latter in favor of a CustomDist. I didn't do it for InverseGamma because that's a pretty popular distribution and don't want to risk messing with precision

closes #7619
closes #7917
closes #7916

@codecov
Copy link

codecov bot commented Nov 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.48%. Comparing base (3a0186e) to head (eec79ee).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #7956   +/-   ##
=======================================
  Coverage   91.47%   91.48%           
=======================================
  Files         116      116           
  Lines       18947    18935   -12     
=======================================
- Hits        17332    17322   -10     
+ Misses       1615     1613    -2     
Files with missing lines Coverage Δ
pymc/distributions/continuous.py 98.23% <100.00%> (-0.03%) ⬇️
pymc/distributions/custom.py 95.52% <100.00%> (+0.07%) ⬆️
pymc/distributions/moments/means.py 100.00% <ø> (ø)
pymc/logprob/transforms.py 95.43% <100.00%> (+0.02%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jessegrabowski
Copy link
Member

Tests are failing because you can't pass rng to the new signatures

Copy link
Member

@larryshamalama larryshamalama left a comment

Choose a reason for hiding this comment

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

Hi @ricardoV94 , great work as always :) I haven't followed much of recent codebase progress, as per @jessegrabowski 's comment other changes seem necessary w.r.t. test failures. I just added minor questions that came to mind as per usual as I read this PR

msg="alpha > 0, beta > 0",
)

def icdf(value, alpha, beta):
Copy link
Member

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_icdf below checks?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

lambda value, alpha, beta: st.invgamma.logcdf(value, alpha, scale=beta),
)

def test_inverse_gamma_icdf(self):
Copy link
Member

Choose a reason for hiding this comment

The 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 (test_half_cauchy), whereas other distributions have one method per functionality. Is there any particular reason for this?

Copy link
Member Author

Choose a reason for hiding this comment

The 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

@ricardoV94
Copy link
Member Author

Tests are failing because you can't pass rng to the new signatures

CustomDist didn't allow passing explicit rng. I tweaked to allow it. This will be useful as we transition to more explicit rng handling internally in the future. Otherwise I could just test the RV differently, since this is such a trivial RV

@ricardoV94 ricardoV94 merged commit 1c0be8f into pymc-devs:main Nov 10, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants