[英]statsmodels.tsa.api.VAR how to plot the results
I want to plot the results based on what is suggested in http://statsmodels.sourceforge.net/stable/vector_ar.html#var . 我想根据http://statsmodels.sourceforge.net/stable/vector_ar.html#var中建议的结果来绘制结果。 However, I don't want to use pandas.
但是,我不想使用熊猫。 The plotting doesn't work and I don't know why.
密谋不起作用,我也不知道为什么。
Here is my code: 这是我的代码:
Y = [data[0,:] , data[1,:]]
import statsmodels.tsa.api
Vmodel = statsmodels.tsa.api.VAR(zip(*Y))
results = Vmodel.fit(2)
print results.summary()
print results.plot()
results.plot_acorr()
results.summary() is working but plotting is not. results.summary()有效,但绘图无效。 I appreciate any help.
感谢您的帮助。
It seems that you just not requesting that the plots are shown to you. 似乎您只是不要求显示图。 Use can use
pylab.show()
. 使用可以使用
pylab.show()
。 For example: 例如:
import statsmodels.tsa.api
import pylab
data = [[ 120.634, 65.766, -402.844, -258.187, 151.982, -370.8 ],
[ 140.634, 65.766, -402.844, -358.187, 151.982, -370.8 ]]
Y = [data[0] , data[1]]
Vmodel = statsmodels.tsa.api.VAR(zip(*Y))
results = Vmodel.fit(2)
print results.summary()
print results.plot()
results.plot_acorr()
pylab.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.