Description
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):
return bound(
a + tt.log1p(tt.exp(b - a)),
0 < value,
0 < mu,
0 < lam,
0 <= alpha,
)