![]() |
Stan Math Library
5.4.0
Automatic Differentiation
|
|
inline |
Multinomial log PMF in log parametrization.
Multinomial(ns| 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.
| ns | Array of outcome counts |
| beta | Vector of unnormalized log probabilities |
| std::invalid_argument | if the sizes of ns and beta do not match |
| std::domain_error | if any element of ns is negative |
| std::domain_error | if beta contains NaN |
| std::domain_error | if beta is non-empty and 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 39 of file multinomial_logit_lpmf.hpp.