This function computes the linear predictor from a matrix of predictor variables and a vector of coefficients. It handles cases with and without an intercept term.
get_linear_predictor(X, coefs)
A vector of linear predictor values.
A matrix of predictor variables.
A vector of coefficients. It should be either the same length as the number of columns in X (for models without an intercept) or one more than the number of columns in X (for models with an intercept).