When I run an old code, I get the following warning: " pandas.stats.ols module is deprecated and will be removed in a future version. We refer to external packages like statsmodels". I could not understand if there is a user-friendly rolling OLS module in statsmodel. What was nice about the pandas.stats.ols module was that you could easily state if an intercept was or not needed, the type of window (rolling, expanding) and the window length. Is there a module that does exactly the same?
For example:
YY = DataFrame(np.log(np.linspace(1,10,10)),columns=['Y'])
XX = DataFrame(np.transpose([np.linspace(1,10,10),np.linspace(2,10,10)]),columns=['XX1','XX2'])
from pandas.stats.ols import MovingOLS
MovingOLS( y=YY['Y'], x=XX, intercept=True, window_type='rolling', window=5).resid
I would like an example of how to get the result of the last line (the residual of the moving ols) using statsmodel or any other module.
Thanks