get_glm_log_density | R Documentation |
This function calculates the log density of the response variable given a generalized linear model (GLM) based on the specified family. The log density is computed differently for binomial and gaussian families.
get_glm_log_density(family_string, X, Y, coefs, weights = 1)
family_string |
Character. The GLM family to use. Options are |
X |
Matrix. The design matrix (predictors) for the GLM. |
Y |
Vector or data frame. The response variable for the GLM. If a data frame, it is converted to a numeric vector. |
coefs |
Numeric vector. The coefficients for the GLM. |
weights |
Numeric vector. Weights for the observations. Default is |
Numeric. The computed log density of the response variable based on the specified family.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.