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

◆ normal_id_glm_lpdf() [2/3]

template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_scale , require_matrix_t< T_x > * = nullptr>
return_type_t< T_y, T_x, T_alpha, T_beta, T_scale > stan::math::normal_id_glm_lpdf ( const T_y &  y,
const T_x &  x,
const T_alpha &  alpha,
const T_beta &  beta,
const T_scale &  sigma 
)

Returns the log PDF of the Generalized Linear Model (GLM) with Normal distribution and id link function.

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

Template Parameters
T_ytype of vector of dependent variables (labels);
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; this can also be a single value;
T_scaletype of the (positive) scale(s); this can be a vector (of the same length as y, for heteroskedasticity) or a scalar.
Parameters
yscalar or vector of dependent variables. 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 (in log odds)
betaweight vector
sigma(Sequence of) scale parameters for the normal distribution.
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif x, beta or alpha is infinite.
std::domain_errorif the scale is not positive.
std::invalid_argumentif container sizes mismatch.

Definition at line 56 of file normal_id_glm_lpdf.hpp.