4

是否有可能(在包vars或其他 R 包中?)在 var 模型中包含非连续滞后,即仅滞后 1 和 3。

到目前为止,看起来当我在 function 下设置 p = 3 时VAR,它包括 1 和 p 之间的所有连续滞后(即 1:3)。

4

1 回答 1

4

您可以使用restrictfrom vars 包来估计受限 VAR。此方法需要对模型进行两次估计:1)具有所有“连续滞后”的无限制模型和 2)仅具有您想要的滞后的受限模型。之所以如此,是因为restrict函数将“varest”类的对象作为输入。查看我的替代方案:

> library(vars)
> data(Canada) # some data
> model <- VAR(Canada[,1:2], p=3) # The unrestricted VAR
> #Bcoef(model) The restriction matrix have to have the same dimension as dim(Bcoef(model))

# Building the restriction matrix
> Restrict <- matrix(c(1,1,0,0,1,1,1,
                       1,1,0,0,1,1,1), nrow=2, byrow=TRUE)

# Re-estimating the VAR with only lags 1 and 3 
> restrict(model, method = "man", resmat = Restrict)

VAR Estimation Results:
======================= 

Estimated coefficients for equation e: 
====================================== 
Call:
e = e.l1 + prod.l1 + e.l3 + prod.l3 + const 

      e.l1    prod.l1       e.l3    prod.l3      const 
 1.2029610  0.1885456 -0.2300286 -0.1299485  1.8382368 


Estimated coefficients for equation prod: 
========================================= 
Call:
prod = e.l1 + prod.l1 + e.l3 + prod.l3 + const 

       e.l1     prod.l1        e.l3     prod.l3       const 
 0.05511963  1.13333804 -0.03338699 -0.18646375  1.22037293 

有关?restrict此功能的更多详细信息,请参阅。

于 2013-05-14T17:13:32.680 回答