This function computes the diagonal elements of the approximate covariance matrix for the coefficients in a generalized linear model (GLM). The covariance is derived from the second derivative (Hessian) of the log-likelihood function.
get_glm_diag_approx_cov(X, model)
Numeric vector. The diagonal elements of the approximate covariance matrix.
Matrix. The design matrix (predictors) for the GLM.
A fitted GLM model object. The object should contain the fitted values and prior weights necessary for computing the Hessian.