get_glm_log_density {catalytic} | R Documentation |
Compute Log Density Based on GLM Family
Description
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.
Usage
get_glm_log_density(family_string, X, Y, coefs, weights = 1)
Arguments
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 |
Value
Numeric. The computed log density of the response variable based on the specified family.
[Package catalytic version 0.1.0 Index]