-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[ENH] Switch regressions to use the pandas implementation #63
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
Conversation
There were several different methods to calculate regressions being used. We should use a consistent method everywhere and Pandas does fast rolling regressions with all sorts of bells and whistles.
I have some questions/concerns about our regression calculations before I do more work on this.
|
@humdings I agree with all your points. My only concern regarding 1. is usability and principle of least surprise (and returning an object rarely is not surprising). Maybe there's a way to have both though but I can't think of something I like.. |
I think there are still some inconsistencies in some of the tests here with regards to how we are treating constant terms in regressions.
I created two new regression calculations - regression - rolling_regression These two functions return the actual ols object so functions can have access to the other metrics the object contains. I also added a 'return_ols_obj' kwarg to functions that call the regression funcs. If it is True, the ols object is also returned. This is for the same reason as above.
Are we going to get this in for the release? |
I think this one is optional. |
In favor of simplicity I removed the option to return the ols model from the calculations that perform regressions. e.g. It is simpler if the beta function just returns the beta coeffecients. All of the regression calculations still call functions that return the underlying model as I think it will be important to be able to access other model data in the future.
bump! Bringing this back up. I think we can include this in the initial ship. It's a pretty simple change that I removed the kwarg to return the model from each of the functions, but I do think having functions This still requires test rewrites which is why travis fails. |
OK, a lot of flake8 errors here have been fixed, and there are going to be merge conflicts. Maybe it makes sense to reset this branch and just make the changes necessary from there? Let me know if you want me to do anything, too. |
@gusgordon That's probably the best way forward. |
Just thought I would add this in pandas-dev/pandas#6077. At some point pandas hopes to move the stats stuff to statsmodels and deprecate it, although as of now I don't believe there is any fast rolling or expanding OLS stuff in statsmodels. |
Thanks @matthewgilbert, good to know. |
Closing due to inactivity. Hopefully we can implement this at a later point. |
There were several different methods to calculate regressions
being used. We should use a consistent method everywhere
and Pandas does fast rolling regressions with all sorts of
bells and whistles.