Skip to content
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

Make StudentT/AsymmetricLaplace .dist() signatures consistent #5628

Merged
merged 22 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
4 changes: 4 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Also check out the [milestones](https://github.com/pymc-devs/pymc/milestones) fo

All of the above apply to:

- `pm.StudentT` now 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)
- ⚠ The library is now named, installed and imported as "pymc". For example: `pip install pymc`.
- ⚠ Theano-PyMC has been replaced with Aesara, so all external references to `theano`, `tt`, and `pymc3.theanof` need to be replaced with `aesara`, `at`, and `pymc.aesaraf` (see [4471](https://github.com/pymc-devs/pymc/pull/4471)).
Expand Down
12 changes: 6 additions & 6 deletions pymc/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,12 +1648,12 @@ class AsymmetricLaplace(Continuous):

Parameters
----------
b: float
Scale parameter (b > 0)
kappa: float
Symmetry parameter (kappa > 0)
mu: float
Location parameter
b: float
Scale parameter (b > 0)

See Also:
--------
Expand All @@ -1662,7 +1662,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))
Expand Down Expand Up @@ -1901,7 +1901,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)
Expand Down Expand Up @@ -2706,7 +2706,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
Expand All @@ -2729,7 +2729,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)
Expand Down