gmm_rolling估计中的方差膨胀因子误差

时间:2018-06-10 17:14:24

标签: r regression rolling-computation generalized-method-of-moments

按照下面的代码,我可以估算滚动gmm函数。

gmm_list_IM <-  lapply(1:(length(ALLX$IM)-24), function(i) {
   tmp <- ALLX[i:(i+23),]
   IM <- as.matrix(as.numeric(tmp$IM))
   p <- nrow(IM) 
   rmrf_local <- as.matrix(as.numeric(tmp$rmrf_local))
   SMB_L <- as.matrix(as.numeric(tmp$SMB_L))
   HML_L <- as.matrix(as.numeric(tmp$HML_L))
   MOM_L <- as.matrix(as.numeric(tmp$MOM_L))
   bond_L <- as.matrix(as.numeric(tmp$bond_L))
   h <- cbind(rmrf_local,SMB_L,HML_L,MOM_L,bond_L)
   gmm(IM ~ rmrf_local+SMB_L+HML_L+MOM_L+bond_L, x=h)
 })

需要计算VIF以检测具有以下错误的多重共线性。

vif(gmm_list_IM)
Error in vcov.default(mod) : 
  there is no vcov() method for models of class list
In addition: Warning message:
In is.na(coef(mod)) :
  is.na() applied to non-(list or vector) of type 'NULL'   Any idea, please?

0 个答案:

没有答案