Skip to content

Commit c20cda2

Browse files
authored
Update docstring in Interpolated, Rice, Moyal, AsymmetricLaplace and PolyaGamma distribution (#5600)
1 parent ff694fb commit c20cda2

File tree

1 file changed

+47
-51
lines changed

1 file changed

+47
-51
lines changed

pymc/distributions/continuous.py

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ class Uniform(BoundedContinuous):
291291
292292
Parameters
293293
----------
294-
lower : float, optional
295-
Lower limit. Defaults to 0.
296-
upper : float, optional
297-
Upper limit. Defaults to 1.
294+
lower : tensor_like of float, default 0
295+
Lower limit.
296+
upper : tensor_like of float, default 1
297+
Upper limit.
298298
"""
299299
rv_op = uniform
300300
bound_args_indices = (3, 4) # Lower, Upper
@@ -319,13 +319,9 @@ def logcdf(value, lower, upper):
319319
320320
Parameters
321321
----------
322-
value : numeric or ndarray or TensorVariable
322+
value : tensor_like of float
323323
Value(s) for which log CDF is calculated. If the log CDF for multiple
324-
values are desired the values must be provided in a numpy array or `TensorVariable`.
325-
lower : float, optional
326-
Lower limit. Defaults to 0.
327-
upper : float, optional
328-
Upper limit. Defaults to 1.
324+
values are desired the values must be provided in a numpy array or Aesara tensor.
329325
330326
Returns
331327
-------
@@ -385,7 +381,7 @@ def logp(value):
385381
----------
386382
value : tensor_like of float
387383
Value(s) for which log-probability is calculated. If the log probabilities for multiple
388-
values are desired the values must be provided in a numpy array or Aesara tensor
384+
values are desired the values must be provided in a numpy array or Aesara tensor.
389385
390386
Returns
391387
-------
@@ -453,7 +449,7 @@ def logp(value):
453449
----------
454450
value : tensor_like of float
455451
Value(s) for which log-probability is calculated. If the log probabilities for multiple
456-
values are desired the values must be provided in a numpy array or Aesara tensor
452+
values are desired the values must be provided in a numpy array or Aesara tensor.
457453
458454
Returns
459455
-------
@@ -575,11 +571,7 @@ def logcdf(value, mu, sigma):
575571
----------
576572
value : tensor_like of float
577573
Value(s) for which log CDF is calculated. If the log CDF for multiple
578-
values are desired the values must be provided in a numpy array or `TensorVariable`.
579-
mu : tensor_like of float
580-
Mean.
581-
sigma : tensor_like of float
582-
Standard deviation (sigma > 0).
574+
values are desired the values must be provided in a numpy array or Aesara tensor.
583575
584576
Returns
585577
-------
@@ -1471,7 +1463,7 @@ class Exponential(PositiveContinuous):
14711463
Parameters
14721464
----------
14731465
lam : tensor_like of float
1474-
Rate or inverse scale (``lam`` > 0)
1466+
Rate or inverse scale (``lam`` > 0).
14751467
"""
14761468
rv_op = exponential
14771469

@@ -1652,12 +1644,12 @@ class AsymmetricLaplace(Continuous):
16521644
16531645
Parameters
16541646
----------
1655-
b: float
1656-
Scale parameter (b > 0)
1657-
kappa: float
1658-
Symmetry parameter (kappa > 0)
1659-
mu: float
1660-
Location parameter
1647+
b : tensor_like of float
1648+
Scale parameter (b > 0).
1649+
kappa : tensor_like of float
1650+
Symmetry parameter (kappa > 0).
1651+
mu : tensor_like of float, default 0
1652+
Location parameter.
16611653
16621654
See Also:
16631655
--------
@@ -1692,9 +1684,9 @@ def logp(value, b, kappa, mu):
16921684
16931685
Parameters
16941686
----------
1695-
value: numeric
1687+
value : tensor_like of float
16961688
Value(s) for which log-probability is calculated. If the log probabilities for multiple
1697-
values are desired the values must be provided in a numpy array or Aesara tensor
1689+
values are desired the values must be provided in a numpy array or Aesara tensor.
16981690
16991691
Returns
17001692
-------
@@ -2345,7 +2337,7 @@ def logcdf(value, alpha, inv_beta):
23452337
value : tensor_like of float
23462338
Value(s) for which log CDF is calculated. If the log CDF for
23472339
multiple values are desired the values must be provided in a numpy
2348-
array or `TensorVariable`.
2340+
array or Aesara tensor.
23492341
23502342
Returns
23512343
-------
@@ -2641,7 +2633,7 @@ def logcdf(value, alpha, beta):
26412633
26422634
Parameters
26432635
----------
2644-
value: numeric or np.ndarray or aesara.tensor
2636+
value : tensor_like of float
26452637
Value(s) for which log CDF is calculated. If the log CDF for multiple
26462638
values are desired the values must be provided in a numpy array or Aesara tensor.
26472639
@@ -3371,6 +3363,7 @@ class Rice(PositiveContinuous):
33713363
\left({\frac {-(x^{2}+\nu ^{2})}{2\sigma ^{2}}}\right)I_{0}\left({\frac {x\nu }{\sigma ^{2}}}\right),
33723364
33733365
.. plot::
3366+
:context: close-figs
33743367
33753368
import matplotlib.pyplot as plt
33763369
import numpy as np
@@ -3397,12 +3390,12 @@ class Rice(PositiveContinuous):
33973390
33983391
Parameters
33993392
----------
3400-
nu: float
3401-
noncentrality parameter.
3402-
sigma: float
3393+
nu : tensor_like of float, optional
3394+
Noncentrality parameter (only required if b is not specified).
3395+
sigma : tensor_like of float, default 1
34033396
scale parameter.
3404-
b: float
3405-
shape parameter (alternative to nu).
3397+
b : tensor_like of float, optional
3398+
Shape parameter (alternative to nu, only required if nu is not specified).
34063399
34073400
Notes
34083401
-----
@@ -3463,9 +3456,9 @@ def logp(value, b, sigma):
34633456
34643457
Parameters
34653458
----------
3466-
value: numeric
3459+
value : tensor_like of float
34673460
Value(s) for which log-probability is calculated. If the log probabilities for multiple
3468-
values are desired the values must be provided in a numpy array or Aesara tensor
3461+
values are desired the values must be provided in a numpy array or Aesara tensor.
34693462
34703463
Returns
34713464
-------
@@ -3724,6 +3717,7 @@ class Interpolated(BoundedContinuous):
37243717
plain array-like objects, so they are constant and cannot be sampled.
37253718
37263719
.. plot::
3720+
:context: close-figs
37273721
37283722
import matplotlib.pyplot as plt
37293723
import numpy as np
@@ -3751,11 +3745,11 @@ class Interpolated(BoundedContinuous):
37513745
37523746
Parameters
37533747
----------
3754-
x_points: array-like
3755-
A monotonically growing list of values. Must be non-symbolic
3756-
pdf_points: array-like
3748+
x_points : array_like
3749+
A monotonically growing list of values. Must be non-symbolic.
3750+
pdf_points : array_like
37573751
Probability density function evaluated on lattice ``x_points``. Must
3758-
be non-symbolic
3752+
be non-symbolic.
37593753
"""
37603754

37613755
rv_op = interpolated
@@ -3805,9 +3799,9 @@ def logp(value, x_points, pdf_points, cdf_points):
38053799
38063800
Parameters
38073801
----------
3808-
value: numeric
3802+
value : tensor_like of float
38093803
Value(s) for which log-probability is calculated. If the log probabilities for multiple
3810-
values are desired the values must be provided in a numpy array or Aesara tensor
3804+
values are desired the values must be provided in a numpy array or Aesara tensor.
38113805
38123806
Returns
38133807
-------
@@ -3860,6 +3854,7 @@ class Moyal(Continuous):
38603854
z = \frac{x-\mu}{\sigma}.
38613855
38623856
.. plot::
3857+
:context: close-figs
38633858
38643859
import matplotlib.pyplot as plt
38653860
import numpy as np
@@ -3885,9 +3880,9 @@ class Moyal(Continuous):
38853880
38863881
Parameters
38873882
----------
3888-
mu: float
3883+
mu : tensor_like of float, default 0
38893884
Location parameter.
3890-
sigma: float
3885+
sigma : tensor_like of float, default 1
38913886
Scale parameter (sigma > 0).
38923887
"""
38933888
rv_op = moyal
@@ -3914,9 +3909,9 @@ def logp(value, mu, sigma):
39143909
39153910
Parameters
39163911
----------
3917-
value: numeric
3912+
value : tensor_like of float
39183913
Value(s) for which log-probability is calculated. If the log probabilities for multiple
3919-
values are desired the values must be provided in a numpy array or Aesara tensor
3914+
values are desired the values must be provided in a numpy array or Aesara tensor.
39203915
39213916
Returns
39223917
-------
@@ -3933,7 +3928,7 @@ def logcdf(value, mu, sigma):
39333928
39343929
Parameters
39353930
----------
3936-
value: numeric or np.ndarray or aesara.tensor
3931+
value : tensor_like of float
39373932
Value(s) for which log CDF is calculated. If the log CDF for multiple
39383933
values are desired the values must be provided in a numpy array or Aesara tensor.
39393934
@@ -4044,6 +4039,7 @@ class PolyaGamma(PositiveContinuous):
40444039
random variable with shape parameter ``h`` and scale parameter ``1``.
40454040
40464041
.. plot::
4042+
:context: close-figs
40474043
40484044
import matplotlib.pyplot as plt
40494045
import numpy as np
@@ -4068,9 +4064,9 @@ class PolyaGamma(PositiveContinuous):
40684064
40694065
Parameters
40704066
----------
4071-
h: float, optional
4067+
h : tensor_like of float, default 1
40724068
The shape parameter of the distribution (h > 0).
4073-
z: float, optional
4069+
z : tensor_like of float, default 0
40744070
The exponential tilting parameter of the distribution.
40754071
40764072
Examples
@@ -4091,7 +4087,7 @@ class PolyaGamma(PositiveContinuous):
40914087
108.504 (2013): 1339-1349.
40924088
.. [2] Windle, Jesse, Nicholas G. Polson, and James G. Scott.
40934089
"Sampling Polya-Gamma random variates: alternate and approximate
4094-
techniques." arXiv preprint arXiv:1405.0506 (2014)
4090+
techniques." arXiv preprint arXiv:1405.0506 (2014).
40954091
.. [3] Luc Devroye. "On exact simulation algorithms for some distributions
40964092
related to Jacobi theta functions." Statistics & Probability Letters,
40974093
Volume 79, Issue 21, (2009): 2251-2259.
@@ -4126,7 +4122,7 @@ def logp(value, h, z):
41264122
41274123
Parameters
41284124
----------
4129-
value: numeric
4125+
value : tensor_like of float
41304126
Value(s) for which log-probability is calculated. If the log
41314127
probabilities for multiple values are desired the values must be
41324128
provided in a numpy array.
@@ -4154,7 +4150,7 @@ def logcdf(value, h, z):
41544150
41554151
Parameters
41564152
----------
4157-
value: numeric or np.ndarray or `TensorVariable`
4153+
value : tensor_like of float
41584154
Value(s) for which log CDF is calculated. If the log CDF for multiple
41594155
values are desired the values must be provided in a numpy array.
41604156

0 commit comments

Comments
 (0)