statsmodels.genmod.generalized_linear_model.GLMResults.get_hat_matrix_diag¶ GLMResults.get_hat_matrix_diag(observed=True)[source]¶ Compute the diagonal of the hat matrix Parameters:¶ observed : bool¶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. Returns:¶ hat_matrix_diag – The diagonal of the hat matrix computed from the observed or expected hessian. Return type:¶ ndarray