Skip to content

Commit a9baa42

Browse files
authored
Correct docs for Bernoulli, Poisson, Negative Binomial, Geometric and HyperGeometric (#5958)
* update docs for Bernoulli, Poisson, Negative Binomial, Geometric and add missing plot context in HyperGeometric * correct spacing Co-authored-by: SangamSwadiK <[email protected]>
1 parent 4ccdf1e commit a9baa42

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

pymc/distributions/discrete.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ class Bernoulli(Discrete):
338338
.. math:: f(x \mid p) = p^{x} (1-p)^{1-x}
339339
340340
.. plot::
341+
:context: close-figs
341342
342343
import matplotlib.pyplot as plt
343344
import numpy as np
@@ -367,9 +368,9 @@ class Bernoulli(Discrete):
367368
368369
Parameters
369370
----------
370-
p: float
371+
p : tensor_like of float
371372
Probability of success (0 < p < 1).
372-
logit_p: float
373+
logit_p : tensor_like of float
373374
Alternative log odds for the probability of success.
374375
"""
375376
rv_op = bernoulli
@@ -569,6 +570,7 @@ class Poisson(Discrete):
569570
.. math:: f(x \mid \mu) = \frac{e^{-\mu}\mu^x}{x!}
570571
571572
.. plot::
573+
:context: close-figs
572574
573575
import matplotlib.pyplot as plt
574576
import numpy as np
@@ -593,7 +595,7 @@ class Poisson(Discrete):
593595
594596
Parameters
595597
----------
596-
mu: float
598+
mu : tensor_like of float
597599
Expected number of occurrences during the given interval
598600
(mu >= 0).
599601
@@ -686,6 +688,7 @@ class NegativeBinomial(Discrete):
686688
(\alpha/(\mu+\alpha))^\alpha (\mu/(\mu+\alpha))^x
687689
688690
.. plot::
691+
:context: close-figs
689692
690693
import matplotlib.pyplot as plt
691694
import numpy as np
@@ -733,13 +736,13 @@ def NegBinom(a, m, x):
733736
734737
Parameters
735738
----------
736-
alpha: float
739+
alpha : tensor_like of float
737740
Gamma distribution shape parameter (alpha > 0).
738-
mu: float
741+
mu : tensor_like of float
739742
Gamma distribution mean (mu > 0).
740-
p: float
743+
p : tensor_like of float
741744
Alternative probability of success in each trial (0 < p < 1).
742-
n: float
745+
n : tensor_like of float
743746
Alternative number of target success trials (n > 0)
744747
"""
745748
rv_op = nbinom
@@ -854,6 +857,7 @@ class Geometric(Discrete):
854857
.. math:: f(x \mid p) = p(1-p)^{x-1}
855858
856859
.. plot::
860+
:context: close-figs
857861
858862
import matplotlib.pyplot as plt
859863
import numpy as np
@@ -877,7 +881,7 @@ class Geometric(Discrete):
877881
878882
Parameters
879883
----------
880-
p: float
884+
p : tensor_like of float
881885
Probability of success on an individual trial (0 < p <= 1).
882886
"""
883887

@@ -963,6 +967,7 @@ class HyperGeometric(Discrete):
963967
.. math:: f(x \mid N, n, k) = \frac{\binom{k}{x}\binom{N-k}{n-x}}{\binom{N}{n}}
964968
965969
.. plot::
970+
:context: close-figs
966971
967972
import matplotlib.pyplot as plt
968973
import numpy as np

0 commit comments

Comments
 (0)