Skip to content

ENH: score residuals for diagnostic, influence, #7897

Open

Description

@josef-pkt

just an idea while browsing influence measures for NegativeBinomial and similar

Stata has "score residuals" that are just the score_factor

Instead, we can use normalized score_obs or contribution to score_test of each observation.
score_obs_i @ inv(hessian) * @ score_obs_i

This might be similar to score_test with a one observation outlier dummy.
There should be related issues, but I don't find them right now.

score_obs in simple one-parameter models is just score_factor * x_i
we need a weighted average (of columns) or quadratic form to get a univariate measure.

One problem: Are score_obs still heteroscedastic? inherently like in poisson, probit, negative binomial, ...

The advantage of score residuals would be that they apply even in models that don't have a mean parameterization.
We need to generalized influence on mean function to influence on arbitrary distribution dargs.

This needs more reading and examples to try out

Activity

  1. added this to the 0.14 milestone on Nov 20, 2021
  2. josef-pkt commented on Nov 29, 2021

    @josef-pkt
    MemberAuthor

    MLEInfluence uses studentized score residual

    I'm not sure this uses an appropriate definition for multi-parameter distributions/models like BetaModel
    However, there is a literature that uses generalized leverage (GL) instead of a mean-parameter hat-matrix for studentizing.
    e.g. Rocha, Sima 2011, p. 101 equ. (9) and references Leiva et al 2007 which also uses GL but with deviance residuals
    That part looks good.
    The question is the denominator which is currently the hessian_factor of the mean component.
    I guess now that this ignores the effect from the second parameter, i.e. second component of the score_factor, hessian_factor.
    Rocha, Sima 2011 have explicit expressions for generalized BetaModel but no "generic", general formula for it. (I will have to track and look at references again.

    Rocha, Sima 2011 , I added it to Zotero in 2011 and 2014, so I might have skimmed it (without checking some of the beta regression specific parts)
    Leiva et al 2007, in zotero: 3 times between 2012 and 2014

    Rocha, Andréa V., and Alexandre B. Simas. 2011. “Influence Diagnostics in a General Class of Beta Regression Models.” TEST 20 (1): 95–119. https://doi.org/10.1007/s11749-010-0189-z.

    Leiva V, BarrosM, Paula GA, GaleaM(2007) Influence diagnostics in log-Birnbaum–Saunders regression
    models with censored data. Comput Stat Data Anal 51:5694–5707

    Aside: R/S mention that score residual coincides with pearson residuals in GLM.
    But that doesn't help for checking multi-parameter models

    Espinheira PL, Ferrari SLP, Cribari-Neto F (2008b) On beta regression residuals. J Appl Stat 35:407–419
    define score residuals as
    "The new residuals we propose are based on Fisher’s scoring iterative algorithm for estimating β when φ is fixed"
    Rocha, Sima use the same but use GL instead of mean-hat-matrix.

    My score residual is based on hessian, i.e. newton-raphson iteration with observed information matrix.
    although BetaModel has an option for eim hessian (observed=False).
    Additionally, they define score residual numerator as y* - mu* while score_factor has an additional term (factor phi * t). so there is still another difference of the definition I use to what they use.

    This definition could be used to derive the score residual for the general case when the second parameter is not assumed to be fixed.

  3. josef-pkt commented on Nov 30, 2021

    @josef-pkt
    MemberAuthor

    more comments on score residuals an my version is in the PR starting here #7912 (comment)

    related:
    we can build up influence and outlier measures based on score_obs that might help identifying problems with cov_params computation.
    Rrelated to possibly bad properties of robust cov_params in small samples and possible outliers or heavy tails in 4th moment.
    Idientification analogue to using outlier robust cov or weights in sandwich computation. e.g. #2942 #3197

  4. josef-pkt commented on Nov 30, 2021

    @josef-pkt
    MemberAuthor

    another article, another definition of score residuals

    Halabi, Susan, Sandipan Dutta, Yuan Wu, and Aiyi Liu. 2020. “Score and Deviance Residuals Based on the Full Likelihood Approach in Survival Analysis.” Pharmaceutical Statistics 19 (6): 940–54. https://doi.org/10.1002/pst.2047.

    Looking only at section 2.2 on score residuals:
    It seems that there score residuals are just our score_obs (=score_factor_i * x_i), i.e. not standardized
    Also, they plug in the estimate of the hazard function, and score_obs are only for the exog part.

  5. josef-pkt commented on Dec 3, 2021

    @josef-pkt
    MemberAuthor

    We might still run into problems with the -sf/hf definition of default residuals as residual for the mean function, if the mean function depends on other parameters.
    Example: parametric link function with estimated link parameter. I saw an article for beta regression (I didn't look at the article)

    Rauber, Cristine, Francisco Cribari-Neto, and Fábio M. Bayer. 2020. “Improved Testing Inferences for Beta Regressions with Parametric Mean Link Function.” AStA Advances in Statistical Analysis 104 (4): 687–717. https://doi.org/10.1007/s10182-020-00376-3.

  6. josef-pkt commented on Dec 14, 2021

    @josef-pkt
    MemberAuthor

    I'm starting to add several types of score residuals to MLEInfluence.
    However, maybe they should be available in results class directly, e.g. #7919
    They main difference would be that MLEInfluence methods have studentize option available, but we don't have the generalized leverage hat_matrix_diag available in most results classes.

  7. josef-pkt commented on Apr 19, 2023

    @josef-pkt
    MemberAuthor

    I'm looking at generalised (generalized) residuals again

    Gourieroux, Christian, Alain Monfort, Eric Renault, and Alain Trognon. “Generalised Residuals.” Journal of Econometrics 34, no. 1–2 (January 1987): 5–32. https://doi.org/10.1016/0304-4076(87)90065-0.

    I don't find an issue, but we discussed/mentioned those a long time ago. (2013 in my Zotero)

    The derivation in Gourieroux et al is difficult to read, and I still have not really worked my way through it.

    However, it looks like for a large class of models this is just our score_factor.
    They also have application for variable addition score test, which looks like is the same as how I implemented it.
    Tobit has two score_factors (second one for variance), all other examples in the article only have one factor, e.g. Probit.
    Also, IIUC, they mention generalised residuals are in general not homoscedastic even if the underlying latent model is.

    Wooldridge on control functions mentions adding generalized residuals in the case of Probit 1st stage, however, AFAICS, his generalized residual is not the same as in Gourieroux et al (probit is an explicit example)

    The article and generalized residuals are worth another look.
    e.g. it provides a reference for score_test based on mean score_factor if there is a second score_factor.
    (Note: that part I also get immediately from the definition of score/LM test if score factors are available)

    Aside: Do I have an issue for score_test for extra params as in negbin NB, and similar? e.g. #7821
    e.g. ZIP with constant inflation versus inflation depending on regressors.

  8. modified the milestones: 0.14, 0.15 on Apr 28, 2023
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions