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

Enhancement request: Add option to use robust regression to the linear fits. #24

Open
lukefullard opened this issue Sep 3, 2024 · 0 comments

Comments

@lukefullard
Copy link

Thank you for a super useful package. I have a suggestion for what I think is a simple enhancement.
I am plotting a periodogram, log(psd) vs log(frequency) and often there are spikes in the plot where there is a significant signal.
These "outliers" can cause the model fit to be biased and I would like to have the option to use robust regression to improve the fit.

Statsmodels has a pretty simple API for this and it is similar to the OLS class.
https://www.statsmodels.org/stable/rlm.html

I think it would be replacing
results = sm.OLS(endog=self.yy, exog=Z).fit()

with something similar to
results= sm.RLM(endog=self.yy, exog=Z, M=sm.robust.norms.HuberT()).fit()

You may also need to check that the output classes but from first glance these look compatible.

Thank you for your consideration.

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

No branches or pull requests

1 participant