1

我使用了 EViews 并运行了纠错模型 (ECM) 并获得了一些结果。现在我想在 R 中复制该示例并获得与 EViews 中相同的结果。

我使用的数据如下:

    gdp<-c(6592.694,7311.75,7756.11,8374.175,9169.984,9994.071,10887.682,11579.432,12440.625,13582.799,15261.26,17728.673,21899.262,29300.921,34933.51,39768.017,42647.701,51144.915,61554.743,73407.498,81467.464,70500.215,70682.449,71496.768,67403.443,68781.085,98203.625,123083.47,131969.428,131738.237,164753.092,172008.565,193073.835,188423.703,201444.061,238561.784,234676.457,207826.099,213329.585,212301.777,192070.75,191678.678,207537.337,253945.777,291430.382,304983.602,324954.402,375041.784,414173.646,381775.165,376575.382)
    life<-c(68.58560976,69.57731707,69.3095122,69.44365854,69.92195122,69.72219512,70.04585366,69.91780488,70.05756098,69.83317073,69.89073171,70.06926829,70.41365854,70.97926829,70.96243902,71.08414634,71.55121951,71.89536585,71.96707317,72.28731707,72.42365854,72.75804878,72.89707317,72.96853659,73.52756098,73.74512195,74.22292683,74.66926829,75.14414634,75.24804878,75.53,75.56780488,75.85536585,76.10634146,76.45707317,76.71560976,76.98365854,77.38756098,77.57317073,77.77560976,78.02682927,78.52682927,78.67804878,78.63170732,79.1804878,79.33170732,79.83170732,79.98292683,80.23414634,80.08292683,80.38292683)

我在 EViews 中获得并希望在 R 中复制的结果如下表所示: 在此处输入图像描述

我使用了 apt包及其功能 ecmAsyFit(gdp, life, lag = 1, split = TRUE,model = "linear", thresh = 0) 我运行的代码如下:

df <- ts(cbind(gdp, life), start = 1950, freq = 1)
fit <-   ecmAsyFit(df[, 1], df[, 2], lag = 1, split = TRUE, model = "linear", thresh = 0)
summary(fit)

R I 得到的结果如下图所示:

              DepVar                 IndVar     estimate     error t.value p.value signif
1  diff.df[, 2].t_0  |            (Intercept)      0.324     0.063   5.135   0.000    ***
2                    | X.diff.df[, 2].t_1.pos     -0.458     0.155  -2.954   0.005    ***
3                    | X.diff.df[, 2].t_1.neg      0.443     0.546   0.811   0.422       
4                    | X.diff.df[, 1].t_1.pos      0.000     0.000   1.410   0.166       
5                    | X.diff.df[, 1].t_1.neg      0.000     0.000  -1.475   0.148      .
6                    |          X.ECT.t_1.pos      0.000     0.000  -1.819   0.076      *
7                    |          X.ECT.t_1.neg      0.000     0.000  -0.420   0.677       
8  diff.df[, 1].t_0  -            (Intercept)   3793.752  4912.683   0.772   0.444       
9                    - X.diff.df[, 2].t_1.pos  -4510.643 12060.505  -0.374   0.710       
10                   - X.diff.df[, 2].t_1.neg -21884.942 42483.319  -0.515   0.609       
11                   - X.diff.df[, 1].t_1.pos      0.576     0.190   3.031   0.004    ***
12                   - X.diff.df[, 1].t_1.neg      0.055     0.369   0.148   0.883       
13                   -          X.ECT.t_1.pos     -0.318     0.145  -2.193   0.034     **
14                   -          X.ECT.t_1.neg     -0.175     0.130  -1.354   0.183       

问题: 我在 EViews 中获得的结果(如表所示)与 R 中的结果不同(如上图所示)

问题:

  1. 有没有办法使用 ecmAsyFit 函数来获得如表中所示的结果?
  2. 是否有另一个函数(或一组函数)可以运行纠错模型并提供表中显示的结果?
  3. 有人可以分享应用纠错模型的代码,以便我可以应用它吗?
4

1 回答 1

1

我认为应该是这样的:

 df <- ts(cbind(gdp, life), start = 1950, freq = 1)

# 对称 VECM

 fit1<- ecmSymFit(df[, 1], df[, 2], lag = 1)

#Setting split=FALSE 使协整对称。

fit2<- ecmAsyFit(df[, 1], df[, 2], lag = 1, split =FALSE, model = "linear", thresh = 0)
summary(fit)
于 2015-01-14T03:08:18.807 回答