When I run the 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 such as statsmodels." I could not understand if the statistical model has a user-friendly OLS module. What was nice about the pandas.stats.ols module was that you can easily indicate whether it needs to be intercepted or not, the type of window (rolling, expanding) and the length of the window. Is there a module that does 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 to get an example of how to get the result of the last line (residual moving ols) using statsmodel or any other module.
thanks
python pandas
serrajo
source share