# [R] Relationship between covariance and inverse covariance matrices

Søren Højsgaard Soren.Hojsgaard at agrsci.dk
Fri Dec 9 00:20:38 CET 2011

```Your question is not all that R-related, but inverse covariance matrices with zero entries corresponds to conditional independence restrictions in the multivaritate normal distribution. Such inverse covariance matrices are key ingredients in graphical Gaussian models (also known as covariance selection models). You may want to study the litterature on such models.

Regards
Søren

________________________________________
Fra: r-help-bounces at r-project.org [r-help-bounces at r-project.org] På vegne af Vivian Shih [vivs at ucla.edu]
Sendt: 8. december 2011 23:42
Til: r-help at r-project.org
Emne: [R] Relationship between covariance and inverse covariance matrices

Hi,

I've been trying to figure out a special set of covariance
matrices that causes some symmetric zero elements in the inverse
covariance matrix but am having trouble figuring out if that is
possible.

Say, for example, matrix a is a 4x4 covariance matrix with equal
variance and zero covariance elements, i.e.

[,1] [,2] [,3] [,4]
[1,]    4    0    0    0
[2,]    0    4    0    0
[3,]    0    0    4    0
[4,]    0    0    0    4

Now if we let a[1,2]=a[2,1]=3, then the inverse covariance matrix
will have nonzero elements on the diagonals as well as for elements
[1,2] and [2,1]. If we further let a[3,4]=a[4,3]=0.5 then the indices
of the nonzero elements of the covariance matrix also matches those
indices of the inverse.

The problem is, if any of the nonzero off-diagonal indices match,
then the inverse covariance matrix will have non-matching nonzero
elements. For example, if a[1,2]=a[2,1]=3 as before but now we'll let
a[2,3]=a[3,2]=0.5, then a would be:

[,1] [,2] [,3] [,4]
[1,]    4  3.0  0.0    0
[2,]    3  4.0  0.5    0
[3,]    0  0.5  4.0    0
[4,]    0  0.0  0.0    4

The inverse covariance matrix is now:
[,1]        [,2]        [,3] [,4]
[1,]  0.58333333 -0.44444444  0.05555556 0.00
[2,] -0.44444444  0.59259259 -0.07407407 0.00
[3,]  0.05555556 -0.07407407  0.25925926 0.00
[4,]  0.00000000  0.00000000  0.00000000 0.25

If we let a[1,2] and a[2,3] be nonzero, then the inverse will
create a nonzero [1,3]. Does that happen all the time? I've tried to
write out the algebraic system of linear equations for a and a-inverse
but couldn't come up with anything.

Let me know if I'm not clear on anything. Basically I'd just like
to see what type of covariance matrices will produce an inverse
covariance matrix with some zero elements.

Thanks,
Vivian

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help