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
The safety checks in the current implementations of categorical_logit_rng and multinomial_logit_rng are too strict. The doc says categorical(softmax(x)) is the same as categorical_logit(x), but that's not the case because softmax allows negative infinite inputs.
There are two things to fix:
Remove the bounds checks in the X_logit_rng functions to allow -infinity.
[Optional] Allow a single +infinity value to produce a deterministic distribution on that value.
Remove the bounds check in X_logit_lpdf and X_logit_lupdf when the argument is a data variable.
For 3, we still need to flag cases where the argument is an autodiff variable because the infinite values will wreak havoc with derivatives.