python - Problem in interpreting the VECM model in Python
问题描述
I have a data set with the name allret_q2btc
with 3 variable columns goldret, equityret and btcret.
I have found the cointegration rank to be 3 and I tried running a VCEM model provided by the statsmodels.tsa.vector_ar.vecm
, however, I am having trouble understanding the results.
VECM_res=VECM(allret_q2btc,k_ar_diff=1,coint_rank=3)
VECM_fit=VECM_res.fit()
VECM_fit.summary()
The following image gives the result of the above code. However, unlike R or Eviews, I couldn't understand the formatting of the result, I am having trouble interpreting the results. Please help me with this.
At the same time I want to know if someone has worked with the above package. If yes, please do tell me what use is VECMResult module in it. Appreciate if any example is attached.
解决方案
首先,请记住 statsmodel 用于 VECM 的这个方程:Δyt=Πyt−1+Γ1Δyt−1+…+Γkar−1Δyt−kar+1+ut
您在 image1 的前 3 个表格中看到的是 VECM(kar-1) 模型的 kar-1(在本例中为 =1)参数矩阵 Γ1,...,Γkar-1 的估计值。您可以使用VECM_fit.gamma
.
其他表格是关于 alpha 和 beta 的估计值。VECM_fit.alpha
您可以直接使用and获得这两个 neqsxcoint_rank(在本例中为 3x3)矩阵VECM_fit.beta
。
注意: Π=αβ′ (Π= VECM_fit.alpha.dot(VECM_fit.beta.T)
)
您可以在此处阅读有关 VECMResult 属性的更多信息:https ://www.statsmodels.org/stable/generated/statsmodels.tsa.vector_ar.vecm.VECMResults.html#statsmodels.tsa.vector_ar.vecm.VECMResults
您还可以通过 获取 VECM(1) 模型的 VAR(2) 表示VECM_fit.var_rep
。
最后,您可以检查:
VECM_fit.var_rep[0]
=VECM_fit.gamma + VECM_fit.alpha.dot(VECM_fit.beta.T) + np.diag(v=[1,1,1])
- 和
VECM_fit.var_rep[1]
=-VECM_fit.gamma
推荐阅读
- computer-science - 不表示序列结束的哨兵术语是什么?
- docker - “docker search” 在 bash 中返回的结果比在 hub.docker.com 上少得多
- python-3.x - 如何在非 Sequential() Keras 模型的层中设置权重和梯度权重
- r - 如何在 1 个图中绘制多个数据集的概率密度函数图?
- three.js - A-Frame:0.9.0 和 0.9.2 版本之间的“透视截图”功能中断?
- docker - 无法使用手动 iptables 在 Dockerfile 中运行 apt-get update
- javascript - JQuery - 单击切换按钮时,附加表会不断增加自身或复制自身
- powershell - 处理目录存在异常
- c++ - 增强器使用先前的 DMatrix 后 XGDMatrixCreateFromMat 失败
- python-3.x - 通过 Python 从 Selenium 使用 WebDriverWait 时不打印异常消息