Skip to content

RLM needs influence statistics #808

Open

Description

@jseabold

Recreated the influence statistics for a notebook, but RLM should have weighted influence stats.

from statsmodels.formula.api import rlm
dta = sm.datasets.statecrime.load_pandas().data

rob_crime_model = rlm("murder ~ urban + poverty + hs_grad + single", data=dta, 
                      M=sm.robust.norms.TukeyBiweight(3)).fit(conv="weights")

weights = rob_crime_model.weights
idx = weights > 0
X = rob_crime_model.model.exog[idx]
ww = weights[idx] / weights[idx].mean()
hat_matrix_diag = ww*(X*np.linalg.pinv(X).T).sum(1)
resid = rob_crime_model.resid
resid2 = resid**2
resid2 /= resid2.sum()
nobs = int(idx.sum())
hm = hat_matrix_diag.mean()
rm = resid2.mean()

Activity

  1. jseabold commented on May 3, 2013

    @jseabold
    MemberAuthor

    Same should apply for WLS.

  2. josef-pkt commented on May 3, 2013

    @josef-pkt
    Member

    Do you have an idea about an R or Stata function to test this against?

  3. jseabold commented on May 3, 2013

    @jseabold
    MemberAuthor
  4. josef-pkt commented on May 3, 2013

    @josef-pkt
    Member

    nice page by ucla,

    I guess the point is to see whether there are still influental or outlier observations left after weighting.

  5. added this to the 0.6 milestone on Apr 8, 2014
  6. jseabold commented on Apr 8, 2014

    @jseabold
    MemberAuthor

    Added a milestone for this. How to use weighted influence statistics for WLS and RLM. Should be low hanging fruit.

  7. modified the milestones: 0.6, 0.7 on Aug 17, 2014
  8. modified the milestones: 0.8, 0.7 on Jul 17, 2015
  9. modified the milestones: 0.8, 0.12 on Apr 14, 2020
  10. josef-pkt commented on Apr 14, 2020

    @josef-pkt
    Member

    just a random find while looking for outlier influence for WLS (I didn't look at the article)

    Seaver, Bill L., and Konstantinos P. Triantis. 1995. “The Impact of Outliers and Leverage Points for Technical Efficiency Measurement Using High Breakdown Procedures.” Management Science 41 (6): 937–56.

  11. modified the milestones: 0.12, 0.13 on Aug 11, 2020
  12. PavloFesenko commented on Dec 10, 2022

    @PavloFesenko
    Contributor

    @jseabold, @josef-pkt Should it be implemented as the class RLMInfluence similar to OLSInfluence (see here)?

    What influence measures should be included? I have found the R function that augments the original dataset used to create RLM with some influence measures, could we start with those?

  13. modified the milestones: 0.13, 0.15 on Dec 11, 2022
  14. josef-pkt commented on Dec 11, 2022

    @josef-pkt
    Member

    @PavloFesenko

    I don't know or remember much about this for RLM.
    If there are similar measures for RLM as for OLS, then we can add an RLMInfluence. GLMInfluence might be relevant because it has weights and IRLS similar to RLM.

    However, RLM is already robust to outliers (to some extent), so standard OLS outlier measures might not be so interesting.
    Influence measures and x-outliers would still be important because those are not handled by RLM methods.

    from the augments page it looks like only hat and sigma would be relevant.

  15. josef-pkt commented on Nov 22, 2023

    @josef-pkt
    Member

    see also example in Song and Kim article
    #9067 (comment)

    some thoughts:

    • outliers in endog space: this confirms outliers that are downweighted by RLM
    • outliers in wendog space: this would check if there are still outliers left after downweighting by RLM
    • influence: eg. dfbeta, actual influence on robust estimator, completely downweighted observation will have no influence left

    Something similar might apply to WLS with var_weights.
    If residual variance of an observation is "known" to be large, then we should not be surprised by large residuals, i.e. those are within the model and not outliers.
    In those cases we actually want to analyze wresid (pearson residuals) and not response residuals.
    (i.e. similar to GLM, Poisson, ...
    )

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