diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 0b0d35ab80..6a23445815 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -26,6 +26,11 @@ Also check out the [milestones](https://github.com/pymc-devs/pymc/milestones) fo All of the above apply to: +Signature and default parameters changed for several distributions (see [#5628](https://github.com/pymc-devs/pymc/pull/5628)): + - `pm.StudentT` now requires either `sigma` or `lam` as kwarg + - `pm.StudentT` now requires `nu` to be specified (no longer defaults to 1) + - `pm.AsymmetricLaplace` positional arguments re-ordered + - `pm.AsymmetricLaplace` now requires `mu` to be specified (no longer defaults to 0) - BART was removed [#5566](https://github.com/pymc-devs/pymc/pull/5566). It is now available from [pymc-experimental](https://github.com/pymc-devs/pymc-experimental) - `BaseStochasticGradient` was removed (see [#5630](https://github.com/pymc-devs/pymc/pull/5630)) - ⚠ The library is now named, installed and imported as "pymc". For example: `pip install pymc`. diff --git a/pymc/distributions/continuous.py b/pymc/distributions/continuous.py index d81a4ce8af..40d4c1a3ac 100644 --- a/pymc/distributions/continuous.py +++ b/pymc/distributions/continuous.py @@ -1646,12 +1646,12 @@ class AsymmetricLaplace(Continuous): Parameters ---------- - b : tensor_like of float - Scale parameter (b > 0). kappa : tensor_like of float Symmetry parameter (kappa > 0). - mu : tensor_like of float, default 0 + mu : tensor_like of float Location parameter. + b : tensor_like of float + Scale parameter (b > 0). See Also: -------- @@ -1660,7 +1660,7 @@ class AsymmetricLaplace(Continuous): rv_op = asymmetriclaplace @classmethod - def dist(cls, b, kappa, mu=0, *args, **kwargs): + def dist(cls, kappa, mu, b, *args, **kwargs): b = at.as_tensor_variable(floatX(b)) kappa = at.as_tensor_variable(floatX(kappa)) mu = mu = at.as_tensor_variable(floatX(mu)) @@ -1899,7 +1899,7 @@ class StudentT(Continuous): rv_op = studentt @classmethod - def dist(cls, nu, mu=0, lam=None, sigma=None, *args, **kwargs): + def dist(cls, nu, mu=0, *, sigma=None, lam=None, **kwargs): nu = at.as_tensor_variable(floatX(nu)) lam, sigma = get_tau_sigma(tau=lam, sigma=sigma) sigma = at.as_tensor_variable(sigma) @@ -2712,7 +2712,7 @@ class HalfStudentT(PositiveContinuous): Parameters ---------- - nu : tensor_like of float, default 1 + nu : tensor_like of float Degrees of freedom, also known as normality parameter (nu > 0). sigma : tensor_like of float, optional Scale parameter (sigma > 0). Converges to the standard deviation as nu @@ -2735,7 +2735,7 @@ class HalfStudentT(PositiveContinuous): rv_op = halfstudentt @classmethod - def dist(cls, nu=1, sigma=None, lam=None, *args, **kwargs): + def dist(cls, nu, sigma=None, lam=None, *args, **kwargs): nu = at.as_tensor_variable(floatX(nu)) lam, sigma = get_tau_sigma(lam, sigma) sigma = at.as_tensor_variable(sigma) diff --git a/pymc/tests/test_distributions.py b/pymc/tests/test_distributions.py index 94ab4e7fb7..4324328ab7 100644 --- a/pymc/tests/test_distributions.py +++ b/pymc/tests/test_distributions.py @@ -1617,6 +1617,7 @@ def test_half_studentt(self): Rplus, {"sigma": Rplus}, lambda value, sigma: sp.halfcauchy.logpdf(value, 0, sigma), + extra_args={"nu": 1}, ) def test_skew_normal(self):