GLS.fit() doesn't attach results to self
Bug #428895 reported by
joep
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
statsmodels |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
GLS.fit() doesn't attach results to self, as a consequence predict fails because of missing results
GLS.results works correctly
Shall we downgrade the fit() method and recommend the use of GLS.results instead, or keep duplicate functionality between fit (method) and results (property) ?
>>> res = sm.OLS(y, X).fit()
>>> res.model.
Traceback (most recent call last):
File "c:\josef\
raise ValueError, "If the model has not been fit, then you must specify the params argument."
ValueError: If the model has not been fit, then you must specify the params argument.
Changed in statsmodels: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
There are two issues here I think underlying this.
The more I thought about it, the more I don't like having the results property. Some models (GLM, etc.) have a fit that takes arguments, so having a results property that returns the fit with default arguments isn't that useful (and I'd like most of the models to be as streamlined as possible).
Also, I'm not sure it makes sense to have predict as a method of the model rather than the results. I tried to connect the two, hence the error that is raised, but having a model method that depends on fit already being called is a bit odd to think about. Maybe it does though for the experimental guys who know what their params should be. I don't know.
This can be fixed, but I think we should make the design decision that this problem is a symptom of before we fix it.