Python Statsmodels示例脚本给出了AttributeError

时间:2014-12-07 19:37:33

标签: python ipython statsmodels

我刚开始研究Python Statsmodels-package。我已经用Statsmodels自己的例子(http://statsmodels.sourceforge.net/devel/examples/notebooks/generated/tsa_arma_0.html)练习预测ARMA模型。

示例在输入行之前完全正常工作:

fig, ax = plt.subplots(figsize=(12, 8))
ax = dta.ix['1950':].plot(ax=ax)
fig = arma_mod30.plot_predict('1990', '2012', dynamic=True, ax=ax, plot_insample=False)

给了我一个错误:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-2a5da9c756f0> in <module>()
  1 fig, ax = plt.subplots(figsize=(12, 8))
  2 ax = dta.ix['1950':].plot(ax=ax)
----> 3 fig = arma_mod30.plot_predict('1990', '2012', dynamic=True, ax=ax, plot_insample=False)

C:\Python27\lib\site-packages\statsmodels\base\wrapper.pyc in __getattribute__(self, attr)
 33             pass
 34 
---> 35         obj = getattr(results, attr)
 36         data = results.model.data
 37         how = self._wrap_attrs.get(attr)

AttributeError: 'ARMAResults' object has no attribute 'plot_predict'

似乎绘图有问题。有什么建议如何解决这个问题?

谢谢!

0 个答案:

没有答案