Skip to content

X_logit_{rng, lpdf, lupdf}(theta) should allow -infinite values in theta #3201

@bob-carpenter

Description

@bob-carpenter

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:

  1. Remove the bounds checks in the X_logit_rng functions to allow -infinity.
  2. [Optional] Allow a single +infinity value to produce a deterministic distribution on that value.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions