Skip to content

Add logcdf implementation for Truncated distributions #6690

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 2 commits into from
Apr 27, 2023

Conversation

shreyas3156
Copy link
Contributor

@shreyas3156 shreyas3156 commented Apr 27, 2023

What is this PR about?
This PR adds the logcdf implementation of Truncated distributions. Addresses #6686.
The CDF here is calculated as: (F(x) - F(a))/(F(b) - F(a)),
where F(x) is the CDF of the base distribution with infinite support.

Checklist

New features

  • Logcdf for Truncated distributions.

📚 Documentation preview 📚: https://pymc--6690.org.readthedocs.build/en/6690/

@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Merging #6690 (3850b8b) into main (9b712bf) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6690      +/-   ##
==========================================
- Coverage   92.01%   92.00%   -0.01%     
==========================================
  Files          95       95              
  Lines       16000    16043      +43     
==========================================
+ Hits        14722    14761      +39     
- Misses       1278     1282       +4     
Impacted Files Coverage Δ
pymc/distributions/truncated.py 99.41% <100.00%> (+0.11%) ⬆️
pymc/logprob/binary.py 96.96% <100.00%> (-1.04%) ⬇️

... and 1 file with indirect coverage changes

base_rv_op = op.base_rv_op
logcdf = _logcdf(base_rv_op, value, *rv_inputs, **kwargs)

# For left truncated RVs, we don't want to include the lower bound in the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# For left truncated RVs, we don't want to include the lower bound in the
# For left truncated discrete RVs, we don't want to include the lower bound in the

@ricardoV94 ricardoV94 merged commit 910d9ef into pymc-devs:main Apr 27, 2023
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