Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REF/ENH: refactor, reuse, generalize robust mean and scale estimates #9189

Open
josef-pkt opened this issue Mar 30, 2024 · 0 comments
Open

Comments

@josef-pkt
Copy link
Member

current (old) code in statsmodels robust

  • norms.estimate_location: M-estimator for mean with fixed scale using weighted mean iteration, optional norm
  • scale.HuberScale M-scale estimate (mean assumed to be zero), hardcoded TrimmedMean.rho,
  • scale.Huber: M-estimator for mean with option for norm simultaneously estimated scale with hard coded TrimmedMean.rho norm
    • iterates estimate_location to maxiter, before updating scale in "outer" iteration loop.

HuberScale is used by RLM.
Huber and estimate_location have no internal use, AFAIR.

I have added similar functions for the multivariate case in robust.covariance.

This should be restructured or replaced to allow for more general norms in scale estimet #9171.

Also, I would like to get S-estimator for mean and scale as a prototype for S-estimator methods. Deterministic starting points for global S-estimator search could be quantiles of the endog.

As pattern, I guess we can use HuberScale class structure for generic MScale, and scale.Huber for generic mean-scale estimators.

I guess what I will do is write new classes following that patter, and then replace HuberScale and Huber once I can replicate it by the general classes.
A helper function estimate_scale similar to norms.estimate_location would allow to outsource all computations inside the "outer iteration".

If we include mean estimate, then we could include inferential statistics like standard errors for mean.
Otherwise, we leave this as simple estimator and wait with inference until we have the regression/RLM/... versions for it.

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

No branches or pull requests

1 participant