Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ multinomial_logit_lpmf() [1/2]

template<bool propto, typename T_beta , typename T_prob = scalar_type_t<T_beta>, require_eigen_col_vector_t< T_beta > * = nullptr>
return_type_t< T_prob > stan::math::multinomial_logit_lpmf ( const std::vector< int > &  ns,
const T_beta &  beta 
)
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.

Parameters
nsArray of outcome counts
betaVector of unnormalized log probabilities
Returns
log probability
Exceptions
std::invalid_argumentif the sizes of ns and beta do not match
std::domain_errorif any element of ns is negative
std::domain_errorif beta contains NaN
std::domain_errorif beta is non-empty and every entry of beta is negative infinity
std::domain_errorif beta is an autodiff (var) type and contains any non-finite value

Definition at line 39 of file multinomial_logit_lpmf.hpp.