![]() |
Stan Math Library
5.4.0
Automatic Differentiation
|
|
inline |
Categorical log PMF in log-odds parametrization.
Categorical(n | softmax(beta))
Entries of beta equal to -inf have zero probability; if any entries are +inf, probability is split evenly among them. These are the limits of softmax: as beta[n] -> -inf, softmax(beta)[n] -> 0, and if k entries -> +inf at the same rate, each has probability 1/k.
| n | Outcome, in 1:size(beta) |
| beta | Vector of log odds (unnormalized log probabilities) |
| std::domain_error | if n is not in 1:size(beta) |
| std::domain_error | if beta contains NaN |
| std::domain_error | if every entry of beta is negative infinity |
| std::domain_error | if beta is an autodiff (var) type and contains any non-finite value |
Definition at line 36 of file categorical_logit_lpmf.hpp.