# Why estimated covariance matrix by glasso is always zero?

I am using glasso function from glasso package, as follow:

obj <- glasso(var(X), rho = 0.09, zero = info, approx=TRUE)


Regardless of rho value, all of entries in obj\$w, estimated covariance matrix, are zero. Do you have any idea why this happens?

For your information, the dimension of var(X) is 1990 x 1990 and the number of rows in info is 1959841.

EDIT: You can download X and info variables as RData file from this link: https://www.dropbox.com/s/t9s4iw6ulbys72o/varX.RData?dl=0

• I don't know anything about this, but a quick perusal of cran.r-project.org/web/packages/glasso/glasso.pdf , shows that your 'info' is being used to specify entries in the estimated (inverse) covariance matrix which are constrained to be zero. Are you constraining all entries to be zero, or at least enough of them that all zeros is the only solution it can find? What are the contents of 'info'? – Mark L. Stone Apr 23 '16 at 16:01
• @MarkL.Stone Indeed I force the algorithm to make most of the entries zero and only about 5300 entries are non-zero which I would like to estimate. – user4704857 Apr 23 '16 at 16:05
• First of all, per the documentation, each element (k,j) is constrained to be zero if (j,k) is constrained to be zero. Does that still leave you with 5300 elements not constrained to be zero? Second of all, however many unconstrained elements you think that leaves you, I presume the estimated matrix must be positive semi-definite (PSD). The elements constrained to be zero can indirectly constrain other elements of the matrix due to the PSD constraint. Are you constraining any diagonal elements to be zero? I think you will find the specification of elements constrained to be zero to be key. – Mark L. Stone Apr 23 '16 at 16:18
• @MarkL.Stone Thanks. The weird thing is that even by running glasso(var(X), rho = 0.01, zero = info[-c(1000:1950000),], approx=TRUE), the estimated cov matrix is still zero!! – user4704857 Apr 23 '16 at 16:37
• What happens when you set zero = NULL (i.e., not specify zero)? Sorry, I don't know what zeros you have specified when you do zero = info[-c(1000:1950000),]. Are you leaving out your first 999 constraints (whatever they are)? – Mark L. Stone Apr 23 '16 at 16:44