使用systemfit进行R SUR回归会导致错误:LU计算为奇数:极端项的比率

时间:2019-01-18 17:58:00

标签: r systemfit

我正在使用R中的systemfit包运行SUR回归。数据集包含80个库的收益,这些收益在虚拟变量上回归,在某些日期等于1,在其他日期等于0。运行此命令时,我总是会遇到相同的错误:

  

.solve.dgC.lu(as(a,“ dgCMatrix”),b = b,tol = tol)中的错误:LU   计算上的单数:| diag(U)|中的极限项比率=   3.703e-20

我将数据集上传到pastebin,所以希望您可以通过运行以下代码轻松复制错误:

library("systemfit")
library("plm")
den <- read.table("https://pastebin.com/raw.php?i=WF3vn1G8", sep=";", header=TRUE)
denpanel<-pdata.frame(den, c("id", "t"))
densur<-systemfit(returns ~ Price + Pre + Event + Post, method = "SUR",data = denpanel)

SUR回归最多可处理78个银行。当我添加第79个银行时,它将不再起作用。

我使用R版本3.5.1(64位)。

非常感谢您的帮助!这是我的第一篇文章,因此,如果我忘记了某些内容,请告诉我。

1 个答案:

答案 0 :(得分:1)

That happens because we have G=80 banks, T=83 observations per bank, and K=5 parameters per bank, giving 83-5=78 degrees of freedom per equation, which is an issue because SUR estimates the GxG residuals covariance matrix. Meanwhile, OLS wouldn't raise any errors and would give the same estimates, but wouldn't compute the covariance matrix and, hence, the standard errors would be different.