template<typename T_x , typename T_alpha , typename T_beta , class RNG >
VectorBuilder< true, int, T_alpha >::type stan::math::bernoulli_logit_glm_rng |
( |
const T_x & |
x, |
|
|
const T_alpha & |
alpha, |
|
|
const T_beta & |
beta, |
|
|
RNG & |
rng |
|
) |
| |
|
inline |
Returns a draw from the Generalized Linear Model (GLM) with Bernoulli distribution and logit link function.
This is a convenience wrapper around bernoulli_logit_rng(alpha + x * beta, rng)
.
- Template Parameters
-
T_x | type of the matrix of independent variables (features); this should be an Eigen::Matrix whose number of columns should match the length of beta; the number of rows is the number of samples. |
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); if a vector its length should match x's row-count; |
T_beta | type of the weight vector; |
RNG | Type of pseudo-random number generator. |
- Parameters
-
x | design matrix |
alpha | intercept (in log odds) |
beta | weight vector |
rng | Pseudo-random number generator. |
- Returns
- Bernoulli logit glm random variate
- Exceptions
-
std::domain_error | if x, beta or alpha is infinite. |
std::invalid_argument | if container sizes mismatch. |
Definition at line 43 of file bernoulli_logit_glm_rng.hpp.