GLMGamResults.get_hat_matrix_diag(observed=True, _axis=1)[source]

Compute the diagonal of the hat matrix


If true, then observed hessian is used in the hat matrix computation. If false, then the expected hessian is used. In the case of a canonical link function both are the same. This is only relevant for models that implement both observed and expected Hessian, which is currently only GLM. Other models only use the observed Hessian.


This is mainly for internal use. By default it returns the usual diagonal of the hat matrix. If _axis is zero, then the result corresponds to the effective degrees of freedom, edf for each column of exog.


The diagonal of the hat matrix computed from the observed or expected hessian.

Last update: Jun 14, 2024