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

◆ binomial_logit_glm_lpmf() [2/3]

template<bool propto, typename T_n , typename T_N , typename T_x , typename T_alpha , typename T_beta , require_matrix_t< T_x > * = nullptr>
return_type_t< T_x, T_alpha, T_beta > stan::math::binomial_logit_glm_lpmf ( const T_n &  n,
const T_N &  N,
const T_x &  x,
const T_alpha &  alpha,
const T_beta &  beta 
)

Returns the log PMF of the Generalized Linear Model (GLM) with Binomial distribution and logit link function.

The idea is that binomial_logit_glm_lpmf(n | N, x, alpha, beta) should compute a more efficient version of binomial_logit_lpmf(y | N, alpha + x * beta) by using analytically simplified gradients. If containers are supplied, returns the log sum of the probabilities.

Template Parameters
T_ntype of binary vector of successes variables; this can also be a single binary value;
T_Ntype of binary vector of population size variables; this can also be a single binary value;
T_xtype of the matrix of independent variables (features)
T_alphatype of the intercept(s); this can be a vector (of the same length as y) of intercepts or a single value (for models with constant intercept);
T_betatype of the weight vector
Parameters
nbinary scalar or vector parameter. If it is a scalar it will be broadcast - used for all instances.
Nbinary scalar or vector parameter. If it is a scalar it will be broadcast - used for all instances.
xdesign matrix or row vector. If it is a row vector it will be broadcast - used for all instances.
alphaintercept
betaweight vector
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif x, beta or alpha is infinite.
std::domain_errorif n is negative or greater than N
std::domain_errorif N is negative
std::invalid_argumentif container sizes mismatch.

Definition at line 56 of file binomial_logit_glm_lpmf.hpp.