简体   繁体   English

statsmodels.tsa.api.VAR如何绘制结果

[英]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.

相关问题 如何从 statsmodels.tsa.api 中提取系数矩阵 - How to extract coefficient matrices from statsmodels.tsa.api 如何为statsmodels.api.tsa.seasonal_decompose制作单面(仅过去值)过滤器 - How to make a one-sided (past values only) filter for statsmodels.api.tsa.seasonal_decompose statsmodels.api.tsa.get_forcast 的参数是什么? - What are the parameter of statsmodels.api.tsa.get_forcast? 如何训练具有多个系列的statsmodels.tsa.ARIMA模型 - How to train statsmodels.tsa.ARIMA model with multiple series 如何将 statsmodels.tsa.seasonal.seasonal_decompose 与 pandas dataframe 一起使用 - How to use statsmodels.tsa.seasonal.seasonal_decompose with a pandas dataframe 如何在 python 中获取 statsmodels.tsa.holtwinters-ExponentialSmoothing 模型的置信区间? - How to take confidence interval of statsmodels.tsa.holtwinters-ExponentialSmoothing Models in python? Statsmodels版本0.6.1不包括tsa? - Statsmodels version 0.6.1 does not include tsa? 如何在 tkinter 中显示 statsmodels 结果? - How to display statsmodels results in tkinter? 如何正确设置statsmodels.tsa.ar_model.AR.predict函数的开始/结束参数 - How to properly set start/end params of statsmodels.tsa.ar_model.AR.predict function 如何使用具有单个分类(3 个级别)自变量的 statsmodels 绘制回归结果? - How to plot regression results using statsmodels with single categorical (3 levels) independent variable?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM