Returns the log PMF of the Generalized Linear Model (GLM) with categorical distribution and logit (softmax) link function.
- Template Parameters
-
T_y | type of classes. It can be either std::vector<int> or int . |
T_x_scalar | type of the matrix of independent variables (features) |
T_alpha | type of the intercept vector |
T_beta | type of the matrix of weights |
- Parameters
-
y | a scalar or vector of classes. If it is a scalar it will be broadcast - used for all instances. Values should be between 1 and number of classes, including endpoints. |
x | design matrix or row vector. If it is a row vector it will be broadcast - used for all instances. |
alpha | intercept vector (in log odds) |
beta | weight matrix |
- Returns
- log probability or log sum of probabilities
- Exceptions
-
std::domain_error | x, beta or alpha is infinite or y is not within bounds |
std::invalid_argument | if container sizes mismatch. |
Definition at line 47 of file categorical_logit_glm_lpmf.hpp.