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

◆ bernoulli_logit_glm_rng()

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_xtype 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_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); if a vector its length should match x's row-count;
T_betatype of the weight vector;
RNGType of pseudo-random number generator.
Parameters
xdesign matrix
alphaintercept (in log odds)
betaweight vector
rngPseudo-random number generator.
Returns
Bernoulli logit glm random variate
Exceptions
std::domain_errorif x, beta or alpha is infinite.
std::invalid_argumentif container sizes mismatch.

Definition at line 43 of file bernoulli_logit_glm_rng.hpp.