R SUR regression using systemfit resulting in error: LU computationally singular: ratio of extreme entries

916 Views Asked by At

I am running a SUR regression using the systemfit package in R. The dataset contains returns for 80 banks which are regressed on dummy variables which are equal to 1 at certain dates and 0 otherwise. When running this, I always obtain the same error:

Error in .solve.dgC.lu(as(a, "dgCMatrix"), b = b, tol = tol) : LU computationally singular: ratio of extreme entries in |diag(U)| = 3.703e-20

I uploaded the dataset to pastebin, so I hope you can easily replicate the error by running this code:

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)

The SUR regression works up to 78 banks. When I add the 79th bank it does not work anymore.

I use R version 3.5.1 (64 bit).

I would really appreciate your help! This is my first post, so please let me know if I forgot something.

1

There are 1 best solutions below

0
On BEST ANSWER

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.