无法将FEVD用于SVAR模型

时间:2019-06-03 15:25:27

标签: python var statsmodels

我将对SVAR模型使用FEVD命令。我需要它来获取模型的预测误差方差分解。但是,我得到一个错误。我需要做些什么才能使代码正常工作?

A = np.asarray([[1,"E",0,0,"E",0,"E"],
                  ["E",1,"E","E",0,0,0],
                  [0,0,1,"E","E",0,0],
                  [0,0,0,1,"E",0,0],
                  [0,0,0,0,1,0,0],
                  [0,0,0,0,"E",1,0],
                  ["E","E","E","E","E","E",1]])

svar_model = sm.tsa.SVAR(df, svar_type="A", A=A) 
svar_result =svar_model.fit(maxlags=6,maxiter = 3000) 

fevd = svar_result.fevd(5)
fevd.summary()

希望得到这个:

FEVD for realgdp
      realgdp  realcons   realinv
0    1.000000  0.000000  0.000000
1    0.864889  0.129253  0.005858
2    0.816725  0.177898  0.005378
3    0.793647  0.197590  0.008763
4    0.777279  0.208127  0.014594

FEVD for realcons
      realgdp  realcons   realinv
0    0.359877  0.640123  0.000000
1    0.358767  0.635420  0.005813
2    0.348044  0.645138  0.006817
3    0.319913  0.653609  0.026478
4    0.317407  0.652180  0.030414

FEVD for realinv
      realgdp  realcons   realinv
0    0.577021  0.152783  0.270196
1    0.488158  0.293622  0.218220
2    0.478727  0.314398  0.206874
3    0.477182  0.315564  0.207254
4    0.466741  0.324135  0.209124

但是,实际上,有此错误:

TypeError: irf() got an unexpected keyword argument 'var_decomp'

0 个答案:

没有答案