首页 > 解决方案 > 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.

Image1 Image2

标签: pythonstatisticsvar

解决方案


首先,请记住 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

推荐阅读