You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FAQ: GLM hat_matrix_diag versus generalized leverage with non-canonical link #7964
It looks like the GLM hat_matrix definition does not agree with the definition of generalized leverage (hat_matrix_diag in MLEInfluence) for Probit.
I'm comparing Probit with GLM-Binomial-probit similar to the existing unit tests comparing Logit and Poisson with their GLM counterparts.
All the pieces agree between Probit and GLM, but the hat_matrix_diag differs by a no-trivial amount.
(The difference in terms of ratio is only around 7% on average, but up to 60% for individual observation)
Currently my only guess is that the GLM definition based on IRLS only agrees with the generalized leverage definition in the case of canonical links. Although, GLMInfluence uses the observed hessian (OIM) in the computation of the hat_matrix_diag.
(OIM does not equal EIM with non-canonical link, but we use observed=True consistently.)
AFAIR, the literature for GLM Influence is all for canonical links like Logit and Poisson.
According to the unit tests GLM-gaussian and OLS also agree (using canonical linear link)
to confirm I changed the unit test to compare Probit MLEInfluence with MLEInfluence of GLM-Binomial-Probit.
The results agree (at relatively high tolerance). So the difference is not between Probit and GLM, it's between GLMInfluence and MLEInfluence definitions of hat_matrix
My intuitive guess:
GLMInfluence keeps weights as fixed when defining the projection matrix. (based on IRLS similar to WLS)
MLEInfluence uses the one step Newton-Raphson approximation without keeping any parts fixed, computing the full derivative.
changed the title [-]maybe FAQ: GLM hat_matrix_diag versus generalized leverage with non-canonical link[/-][+]FAQ: GLM hat_matrix_diag versus generalized leverage with non-canonical link[/+]on Dec 20, 2021
That's now a FAQ issue. We don't change Probit MLEInfluence. GLMResults.get_influence returns GLMInfluence, but users can call MLEInfluence(results_glm) (which I do in the unit tests)
Activity
[-]maybe FAQ: GLM hat_matrix_diag versus generalized leverage with non-canonical link[/-][+]FAQ: GLM hat_matrix_diag versus generalized leverage with non-canonical link[/+]josef-pkt commentedon Dec 20, 2021
That's now a FAQ issue. We don't change Probit MLEInfluence.
GLMResults.get_influencereturns GLMInfluence, but users can callMLEInfluence(results_glm)(which I do in the unit tests)