Skip to content

FAQ: GLM hat_matrix_diag versus generalized leverage with non-canonical link #7964

Open

Description

@josef-pkt

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.

Activity

  1. added this to the 0.14 milestone on Dec 20, 2021
  2. 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
  3. removed this from the 0.14 milestone on Dec 20, 2021
  4. josef-pkt commented on Dec 20, 2021

    @josef-pkt
    MemberAuthor

    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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions