You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wald's logcdf checks a lot of conditions for degenerate distribution parameters/values that =0 or =np.inf to decide whether to return a logcdf of -inf or 0. As far as I can tell, this is the only distribution that goes to such lengths to accommodate degenerate cases, some of which are not even allowed by the distribution initialization (or the docstrings or the logp):
Note that the explicit bound parameter checks were added only recently in #4421 and were not in the original implementation of the logcdf method. In fact, they overwrite several of the degenerate lam == 0 checks as well as some implicit (I think) value >= mu & mu == 0 checks.
Also, AFAIK these degenerate conditions are not being tested anywhere.
Unless there is a good reason for it, I would suggest stripping away the degenerate case switches, and simply have something like the following (which I haven't tested yet):
The degenerate case is not supposed to be allowed as per the docstrings / conventional definition of parameter support (e.g., Wikipedia). In this case it will simply be captured by the bound and return -np.inf. This is no worse than what happens with a Normal with sigma=0 (that one actually raises a ZeroDivisionError).
Wald's logcdf checks a lot of conditions for degenerate distribution parameters/values that
=0
or=np.inf
to decide whether to return a logcdf of-inf
or0
. As far as I can tell, this is the only distribution that goes to such lengths to accommodate degenerate cases, some of which are not even allowed by the distribution initialization (or the docstrings or the logp):https://github.com/pymc-devs/pymc3/blob/823906a3efcf66897eac8a4c89052d9153bca49e/pymc3/distributions/continuous.py#L1138-L1162
Note that the explicit bound parameter checks were added only recently in #4421 and were not in the original implementation of the logcdf method. In fact, they overwrite several of the degenerate
lam == 0
checks as well as some implicit (I think)value >= mu & mu == 0
checks.Also, AFAIK these degenerate conditions are not being tested anywhere.
Unless there is a good reason for it, I would suggest stripping away the degenerate case switches, and simply have something like the following (which I haven't tested yet):
The text was updated successfully, but these errors were encountered: