I want to use the statsmodels.regression.linear_model.OLS package to do a prediction, but with a specified constant.
Currently, I can specify the presence of a constant with an argument:
(from docs: http://statsmodels.sourceforge.net/devel/generated/statsmodels.regression.linear_model.OLS.html)
class statsmodels.regression.linear_model.OLS(endog, exog=None, missing='none', hasconst=None), where hasconst is a boolean.
What I want to do is specify explicitly a constant C, and then fit a linear regression model around it. From using that OLS, I want to generate a and then access all the attributes like resid, etc.
A current suboptimal work around would be to specify the OLS without a constant, subtract the constant from the Y-values, and create a custom object that wraps both the specified constant and OLS w/o constant, every time I want to do predict or fit, to first subtract the constant from the Y variables, and then use the prediction.
Thanks!