Skip to content

Updates to pymc.Hypergeometric docstrings #5488

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 6 commits into from
Mar 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions pymc/distributions/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,12 +971,12 @@ class HyperGeometric(Discrete):

Parameters
----------
N : integer
Total size of the population
k : integer
Number of successful individuals in the population
n : integer
Number of samples drawn from the population
N : tensor_like of integer
Total size of the population (N > 0)
k : tensor_like of integer
Number of successful individuals in the population (0 <= k <= N)
n : tensor_like of integer
Number of samples drawn from the population (0 <= n <= N)
"""

rv_op = hypergeometric
Expand Down Expand Up @@ -1004,6 +1004,10 @@ def logp(value, good, bad, n):
value : numeric
Value(s) for which log-probability is calculated. If the log probabilities for multiple
values are desired the values must be provided in a numpy array or Aesara tensor
good : integer, array_like or TensorVariable
Number of successful individuals in the population. Alias for parameter :math:`k`.
bad : integer, array_like or TensorVariable
Number of unsuccessful individuals in the population. Alias for :math:`N-k`.
Comment on lines +1007 to +1010
Copy link
Member Author

Choose a reason for hiding this comment

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

Should we also use "tensor_like of integer" here @OriolAbril ?

Copy link
Member

Choose a reason for hiding this comment

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

We are in the process of removing the distribution methods from the documentation and leaving only the dist one. The Distribution class is still being refactored, see #5308 for some more details (I don't really understand what is going on very well) and those methods might be removed completely, and because they should not be used themselves already but called via pm.logp() or pm.logcdf

I think it's best to leave them be for now.


Returns
-------
Expand Down Expand Up @@ -1042,8 +1046,14 @@ def logcdf(value, good, bad, n):

Parameters
----------
value: numeric
value : numeric
Value for which log CDF is calculated.
good : integer
Number of successful individuals in the population. Alias for parameter :math:`k`.
bad : integer
Number of unsuccessful individuals in the population. Alias for :math:`N-k`.
n : integer
Number of samples drawn from the population (0 <= n <= N)

Returns
-------
Expand Down