You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error says that TimeSeriesModel (super or super's super object) has no _get_predict_start. But VAR needs it. I only find _get_predict_index in TimeSeriesModel.
File "/Users/william/Folders/临时文件夹/script.py", line 17, in
print(results.model.predict(['2015']))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/statsmodels/tsa/vector_ar/var_model.py", line 535, in predict
start = self._get_predict_start(start, lags)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/statsmodels/tsa/vector_ar/var_model.py", line 529, in _get_predict_start
return super(VAR, self)._get_predict_start(start)
AttributeError: 'super' object has no attribute '_get_predict_start'
@Freakwill Thanks for reporting. This is most likely a refactoring victim, and AFAICS, there is no test coverage for it.
Note predict is a model method and the first argument is params. There is no corresponding results predict method for insample dynamic prediction. I only have seen the forecast method in use for VAR.
We need a unit test case to check if the function has just been renamed or has now a incompatible behavior.
You should be able to use VARMAX as workaround for dynamic insample prediction in a VAR model. VARMAXResults has predict and get_prediction and a dynamic keyword.
Activity
Freakwill commentedon Jul 6, 2018
I think, just change one of them
josef-pkt commentedon Jul 6, 2018
@Freakwill Thanks for reporting. This is most likely a refactoring victim, and AFAICS, there is no test coverage for it.
Note
predictis a model method and the first argument is params. There is no corresponding resultspredictmethod for insample dynamic prediction. I only have seen theforecastmethod in use for VAR.We need a unit test case to check if the function has just been renamed or has now a incompatible behavior.
You should be able to use VARMAX as workaround for dynamic insample prediction in a VAR model. VARMAXResults has predict and get_prediction and a dynamic keyword.
[-]I find a bug[/-][+]BUG VAR.predict is broken[/+]ChadFulton commentedon Jul 6, 2018
Yes, unfortunately the use of the new date / time handling in 6c1f892#diff-e2d6024b9d0ed6c0410bf2fffc1f1254R342 was overridden subsequently. I can make a PR to replace the working behavior.
ChadFulton commentedon Jul 6, 2018
Fixed by #4785 along with another bug I happened to notice.
realdtrump commentedon Aug 20, 2018
The bug has reappeared when trying to use predict method for VAR:
AttributeError: 'super' object has no attribute '_get_predict_start'