Skip to content

Commit ff694fb

Browse files
authored
Update docstring in ChiSquared, HalfNormal, Wald, Pareto, ExGaussion and VonMiese distribution (#5595)
* Fixed ChiSquared, HalfNormal, Wald, Pareto, ExGaussion and VonMiese docstring * fixed optional parameter * fixed TensorVariable
1 parent a281885 commit ff694fb

File tree

1 file changed

+42
-33
lines changed

1 file changed

+42
-33
lines changed

pymc/distributions/continuous.py

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,10 @@ class HalfNormal(PositiveContinuous):
818818
the standard deviation/precision of the unfolded normal distribution, for
819819
the standard deviation of the half-normal distribution, see below. For
820820
the half-normal, they are just two parameterisation :math:`\sigma^2
821-
\equiv \frac{1}{\tau}` of a scale parameter
821+
\equiv \frac{1}{\tau}` of a scale parameter.
822822
823823
.. plot::
824+
:context: close-figs
824825
825826
import matplotlib.pyplot as plt
826827
import numpy as np
@@ -844,10 +845,12 @@ class HalfNormal(PositiveContinuous):
844845
845846
Parameters
846847
----------
847-
sigma: float
848-
Scale parameter :math:`sigma` (``sigma`` > 0) (only required if ``tau`` is not specified).
849-
tau: float
850-
Precision :math:`tau` (tau > 0) (only required if sigma is not specified).
848+
sigma : tensor_like of float, optional
849+
Scale parameter :math:`\sigma` (``sigma`` > 0) (only required if ``tau`` is not specified).
850+
Defaults to 1.
851+
tau : tensor_like of float, optional
852+
Precision :math:`\tau` (tau > 0) (only required if sigma is not specified).
853+
Defaults to 1.
851854
852855
Examples
853856
--------
@@ -883,7 +886,7 @@ def logcdf(value, loc, sigma):
883886
884887
Parameters
885888
----------
886-
value: numeric or np.ndarray or aesara.tensor
889+
value : tensor_like of float
887890
Value(s) for which log CDF is calculated. If the log CDF for multiple
888891
values are desired the values must be provided in a numpy array or Aesara tensor.
889892
@@ -935,6 +938,7 @@ class Wald(PositiveContinuous):
935938
\right\}
936939
937940
.. plot::
941+
:context: close-figs
938942
939943
import matplotlib.pyplot as plt
940944
import numpy as np
@@ -967,13 +971,13 @@ class Wald(PositiveContinuous):
967971
968972
Parameters
969973
----------
970-
mu: float, optional
974+
mu : tensor_like of float, optional
971975
Mean of the distribution (mu > 0).
972-
lam: float, optional
976+
lam : tensor_like of float, optional
973977
Relative precision (lam > 0).
974-
phi: float, optional
978+
phi : tensor_like of float, optional
975979
Alternative shape parameter (phi > 0).
976-
alpha: float, optional
980+
alpha : tensor_like of float, default 0
977981
Shift/location parameter (alpha >= 0).
978982
979983
Notes
@@ -1060,14 +1064,14 @@ def logp(
10601064
10611065
Parameters
10621066
----------
1063-
value: numeric
1067+
value : tensor_like of float
10641068
Value(s) for which log-probability is calculated. If the log probabilities for multiple
1065-
values are desired the values must be provided in a numpy array or Aesara tensor
1066-
mu: float or TensorVariable
1069+
values are desired the values must be provided in a numpy array or Aesara tensor.
1070+
mu : tensor_like of float
10671071
Mean of the distribution (mu > 0).
1068-
lam: float or TensorVariable
1072+
lam : tensor_like of float
10691073
Relative precision (lam > 0).
1070-
alpha: float or TensorVariable
1074+
alpha : tensor_like of float
10711075
Shift/location parameter (alpha >= 0).
10721076
10731077
Returns
@@ -1105,14 +1109,14 @@ def logcdf(
11051109
11061110
Parameters
11071111
----------
1108-
value: numeric or np.ndarray or aesara.tensor
1112+
value : tensor_like of float
11091113
Value(s) for which log CDF is calculated. If the log CDF for multiple
11101114
values are desired the values must be provided in a numpy array or Aesara tensor.
1111-
mu: float or TensorVariable
1115+
mu : tensor_like of float
11121116
Mean of the distribution (mu > 0).
1113-
lam: float or TensorVariable
1117+
lam : tensor_like of float
11141118
Relative precision (lam > 0).
1115-
alpha: float or TensorVariable
1119+
alpha : tensor_like of float
11161120
Shift/location parameter (alpha >= 0).
11171121
11181122
Returns
@@ -1982,6 +1986,7 @@ class Pareto(BoundedContinuous):
19821986
f(x \mid \alpha, m) = \frac{\alpha m^{\alpha}}{x^{\alpha+1}}
19831987
19841988
.. plot::
1989+
:context: close-figs
19851990
19861991
import matplotlib.pyplot as plt
19871992
import numpy as np
@@ -2008,9 +2013,9 @@ class Pareto(BoundedContinuous):
20082013
20092014
Parameters
20102015
----------
2011-
alpha: float
2016+
alpha : tensor_like of float
20122017
Shape parameter (alpha > 0).
2013-
m: float
2018+
m : tensor_like of float
20142019
Scale parameter (m > 0).
20152020
"""
20162021
rv_op = pareto
@@ -2045,7 +2050,7 @@ def logcdf(
20452050
20462051
Parameters
20472052
----------
2048-
value: numeric or np.ndarray or aesara.tensor
2053+
value : tensor_like of float
20492054
Value(s) for which log CDF is calculated. If the log CDF for multiple
20502055
values are desired the values must be provided in a numpy array or Aesara tensor.
20512056
@@ -2493,6 +2498,7 @@ class ChiSquared(PositiveContinuous):
24932498
f(x \mid \nu) = \frac{x^{(\nu-2)/2}e^{-x/2}}{2^{\nu/2}\Gamma(\nu/2)}
24942499
24952500
.. plot::
2501+
:context: close-figs
24962502
24972503
import matplotlib.pyplot as plt
24982504
import numpy as np
@@ -2517,7 +2523,7 @@ class ChiSquared(PositiveContinuous):
25172523
25182524
Parameters
25192525
----------
2520-
nu: float
2526+
nu : tensor_like of float
25212527
Degrees of freedom (nu > 0).
25222528
"""
25232529
rv_op = chisquare
@@ -2540,10 +2546,11 @@ def logcdf(value, nu):
25402546
25412547
Parameters
25422548
----------
2543-
value: numeric or np.ndarray or `TensorVariable`
2549+
value : tensor_like of float
25442550
Value(s) for which log CDF is calculated. If the log CDF for
25452551
multiple values are desired the values must be provided in a numpy
2546-
array or `TensorVariable`.
2552+
array or Aesara tensor.
2553+
25472554
Returns
25482555
-------
25492556
TensorVariable
@@ -2813,6 +2820,7 @@ class ExGaussian(Continuous):
28132820
standard normal distribution.
28142821
28152822
.. plot::
2823+
:context: close-figs
28162824
28172825
import matplotlib.pyplot as plt
28182826
import numpy as np
@@ -2839,11 +2847,11 @@ class ExGaussian(Continuous):
28392847
28402848
Parameters
28412849
----------
2842-
mu: float
2850+
mu : tensor_like of float, default 0
28432851
Mean of the normal distribution.
2844-
sigma: float
2852+
sigma : tensor_like of float
28452853
Standard deviation of the normal distribution (sigma > 0).
2846-
nu: float
2854+
nu : tensor_like of float
28472855
Mean of the exponential distribution (nu > 0).
28482856
28492857
References
@@ -2884,9 +2892,9 @@ def logp(value, mu, sigma, nu):
28842892
28852893
Parameters
28862894
----------
2887-
value: numeric
2895+
value : tensor_like of float
28882896
Value(s) for which log-probability is calculated. If the log probabilities for multiple
2889-
values are desired the values must be provided in a numpy array or Aesara tensor
2897+
values are desired the values must be provided in a numpy array or Aesara tensor.
28902898
28912899
Returns
28922900
-------
@@ -2924,7 +2932,7 @@ def logcdf(value, mu, sigma, nu):
29242932
29252933
Parameters
29262934
----------
2927-
value: numeric or np.ndarray or aesara.tensor
2935+
value : tensor_like of float
29282936
Value(s) for which log CDF is calculated. If the log CDF for multiple
29292937
values are desired the values must be provided in a numpy array or Aesara tensor.
29302938
@@ -2964,6 +2972,7 @@ class VonMises(CircularContinuous):
29642972
where :math:`I_0` is the modified Bessel function of order 0.
29652973
29662974
.. plot::
2975+
:context: close-figs
29672976
29682977
import matplotlib.pyplot as plt
29692978
import numpy as np
@@ -2989,9 +2998,9 @@ class VonMises(CircularContinuous):
29892998
29902999
Parameters
29913000
----------
2992-
mu: float
3001+
mu : tensor_like of float, default 0
29933002
Mean.
2994-
kappa: float
3003+
kappa : tensor_like of float
29953004
Concentration (\frac{1}{kappa} is analogous to \sigma^2).
29963005
"""
29973006

0 commit comments

Comments
 (0)