VECM in R:测试弱外生性并施加限制

问题描述

我估计了 VECM ,并希望对每个变量进行4次弱外生性的独立测试。

library(urca)
library(vars)

data(Canada)
               e     prod       rw     U
1980 Q1 929.6105 405.3665 386.1361  7.53
1980 Q2 929.8040 404.6398 388.1358  7.70
1980 Q3 930.3184 403.8149 390.5401  7.47
1980 Q4 931.4277 404.2158 393.9638  7.27
1981 Q1 932.6620 405.0467 396.7647  7.37
1981 Q2 933.5509 404.4167 400.0217  7.13
...

jt = ca.jo(Canada,type = "trace",ecdet = "const",K = 2,spec = "transitory")

t = cajorls(jt,r = 1)
t$rlm$coefficients
                  e.d       prod.d        rw.d         U.d
ect1     -0.005972228  0.004658649 -0.10607044 -0.02190508
e.dl1     0.812608320 -0.063226620 -0.36178542 -0.60482042
prod.dl1  0.208945048  0.275454380 -0.08418285 -0.09031236
rw.dl1   -0.045040603  0.094392696 -0.05462048 -0.01443323
U.dl1     0.218358784 -0.538972799  0.24391761 -0.16978208

t$beta
                  ect1
e.l1        1.00000000
prod.l1     0.08536852
rw.l1      -0.14261822
U.l1        4.28476955
constant -967.81673980

我想我的方程式是:

enter image description here

,我想测试 alpha_e alpha_prod alpha_rw alpha_U (在上图)为零,并对我的模型施加了必要的限制。 所以,我的问题是:我该怎么办?

我猜我估计的 alphas 是:

                  e.d       prod.d        rw.d         U.d
ect1     -0.005972228  0.004658649 -0.10607044 -0.02190508

我想我应该使用 urca 库中的 alrtest 函数:

alrtest(z = jt,A = A1,r = 1)

,也许我的 alpha_e A 矩阵应该是这样的:

A1 = matrix(c(0,1,1),nrow = 4,ncol = 3,byrow = TRUE)

测试结果:

jt1 = alrtest(z = jt,A = A,r = 1)
summary(jt1)

The value of the likelihood ratio test statistic:
0.48 distributed as chi square with 1 df.
The p-value of the test statistic is: 0.49

Eigenvectors,normalised to first column
of the restricted VAR:

                 [,1]
RK.e.l1        1.0000
RK.prod.l1     0.1352
RK.rw.l1      -0.1937
RK.U.l1        3.9760
RK.constant -960.2126

Weights W of the restricted VAR:

        [,1]
[1,]  0.0000
[2,]  0.0084
[3,] -0.1342
[4,] -0.0315

我猜这意味着我不能拒绝我关于 alpha_e 的弱外生性的假设。我的新 alphas 分别是:0.0000、0.0084,-0.1342,-0.0315。

现在的问题是,如何对我的 VECM 模型施加此限制?

如果我这样做:

t1 = cajorls(jt1,r = 1)
t1$rlm$coefficients
                  e.d       prod.d        rw.d         U.d
ect1     -0.005754775  0.007717881 -0.13282970 -0.02848404
e.dl1     0.830418381 -0.049601229 -0.30644063 -0.60236338
prod.dl1  0.207857861  0.272499006 -0.06742147 -0.08561076
rw.dl1   -0.037677197  0.102991919 -0.05986655 -0.02019326
U.dl1     0.231855899 -0.530897862  0.30720652 -0.16277775
t1$beta
                 ect1
e.l1        1.0000000
prod.l1     0.1351633
rw.l1      -0.1936612
U.l1        3.9759842
constant -960.2126150

对于 alpha ,新模型没有0.0000、0.0084,-0.1342和-0.0315。而是-0.005754775 0.007717881 -0.13282970 -0.02848404。

如何使用 alpha_e = 0 重新估算模型?我想使用 alpha_e = 0 重新估算模型,因为我想将其用于预测( vecm -> vec2var -> 预测,但 vec2var 不直接接受 jt1 )。总的来说-我所做的计算是否正确?

仅出于说明目的,在 EViews 中对 alpha 施加了限制(如下所示):

enter image description here

enter image description here

解决方法

如果你有 1 个协整关系 (r=1),就像 t = cajorls(jt,r = 1), 您的加载矩阵不能有 4 行 3 列:

A1 = matrix(c(0,1,1),nrow = 4,ncol = 3,byrow = TRUE)

矩阵 A 只能有 4 行和 1 列,如果您有 4 个变量和 1 个协整关系。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...