Skip to content

Allow logcdf and icdf inference #6597

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 1 commit into from
Mar 30, 2023
Merged

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Mar 13, 2023

This PR allows inference of logcdf and icdf variables (similar to how logp was already possible)

import pymc as pm

dist = pm.Normal.dist().exp()

print(pm.logcdf(dist, 1.0).eval())  # -0.6931471805599453
print(pm.icdf(dist, 0.7).eval())  # 1.6894457434840042

Important

This PR first 3 commits now belong to #6599, only the last one should be reviewed here

@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Merging #6597 (360ef6e) into main (2fcce43) will decrease coverage by 18.59%.
The diff coverage is 58.24%.

❗ Current head 360ef6e differs from pull request most recent head 0636f4e. Consider uploading reports for the commit 0636f4e to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #6597       +/-   ##
===========================================
- Coverage   92.03%   73.44%   -18.59%     
===========================================
  Files          93       92        -1     
  Lines       15746    15591      -155     
===========================================
- Hits        14492    11451     -3041     
- Misses       1254     4140     +2886     
Impacted Files Coverage Δ
pymc/logprob/transforms.py 57.14% <22.22%> (-39.00%) ⬇️
pymc/distributions/mixture.py 59.19% <33.33%> (-36.24%) ⬇️
pymc/logprob/mixture.py 31.28% <33.33%> (-67.24%) ⬇️
pymc/logprob/scan.py 19.79% <33.33%> (-77.42%) ⬇️
pymc/logprob/tensor.py 41.52% <33.33%> (-39.84%) ⬇️
pymc/logprob/basic.py 80.00% <50.00%> (ø)
pymc/logprob/cumsum.py 42.42% <50.00%> (-57.58%) ⬇️
pymc/logprob/abstract.py 89.28% <78.94%> (-8.31%) ⬇️
pymc/distributions/bound.py 46.15% <100.00%> (-53.85%) ⬇️
pymc/distributions/continuous.py 97.69% <100.00%> (-0.01%) ⬇️
... and 7 more

... and 36 files with indirect coverage changes

@ricardoV94 ricardoV94 force-pushed the infer_logcdf branch 3 times, most recently from f19f58c to ce86774 Compare March 13, 2023 21:32
@ricardoV94 ricardoV94 added the major Include in major changes release notes section label Mar 13, 2023
@ricardoV94 ricardoV94 force-pushed the infer_logcdf branch 2 times, most recently from 360ef6e to 1cca656 Compare March 14, 2023 10:22
@ricardoV94 ricardoV94 removed the major Include in major changes release notes section label Mar 14, 2023
@ricardoV94 ricardoV94 marked this pull request as draft March 14, 2023 10:27
@ricardoV94
Copy link
Member Author

Marking as a draft as this PR now includes the commits of #6599 which should be merged first. Only the last one matters here (and can be reviewed alone)

@ricardoV94 ricardoV94 force-pushed the infer_logcdf branch 2 times, most recently from db48d7d to 0ffd980 Compare March 14, 2023 10:34
@ricardoV94 ricardoV94 removed the request for review from michaelosthege March 14, 2023 10:34
@michaelosthege michaelosthege added this to the v5.2.0 milestone Mar 16, 2023
@ricardoV94 ricardoV94 marked this pull request as ready for review March 29, 2023 07:11
@ricardoV94
Copy link
Member Author

Ready for review

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.

2 participants