Stan Math Library
5.0.0
Automatic Differentiation
|
return_type_t< T_x, T_alpha, T_beta > stan::math::poisson_log_glm_lpmf | ( | const T_y & | y, |
const T_x & | x, | ||
const T_alpha & | alpha, | ||
const T_beta & | beta | ||
) |
Returns the log PMF of the Generalized Linear Model (GLM) with Poisson distribution and log link function.
The idea is that poisson_log_glm_lpmf(y, x, alpha, beta) should compute a more efficient version of poisson_log_lpmf(y, alpha + x * beta) by using analytically simplified gradients. If containers are supplied, returns the log sum of the probabilities.
T_y | type of vector of variates (labels), integers >=0; this can also be a single positive integer; |
T_x | type the matrix of independent variables (features) |
T_x_rows | compile-time number of rows of x . It can be either Eigen::Dynamic or 1. |
T_alpha | type 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_beta | type of the weight vector; this can also be a single value; |
y | positive integer scalar or vector parameter. If it is a scalar it will be broadcast - used for all instances. |
x | design matrix or row vector. If it is a row vector it will be broadcast - used for all instances. |
alpha | intercept (in log odds) |
beta | weight vector |
std::domain_error | if x, beta or alpha is infinite. |
std::domain_error | if y is negative. |
std::invalid_argument | if container sizes mismatch. |
Definition at line 53 of file poisson_log_glm_lpmf.hpp.