[R] extracting the diagonal of an inverse matrix

Camarda, Carlo Giovanni Camarda at demogr.mpg.de
Fri Apr 19 16:13:43 CEST 2013


Dear R-users,

I would like to know whether there is a way to extract a diagonal of an inverse matrix without computing the inverse of the matrix itself. The size of my matrices are really huge and, also using sparse matrix, computing the inverse leads to storage problems and low speed.

In other words, given a square matrix A, I aim to know diag(B), where B=solve(A), without computing solve(A). 

Accidentally (I do not know whether it helps), I could write the matrix A as follows: 
A <- D + P
where D is a diagonal matrix. 

I read there are methods around, but, before implementing one of them by myself, could you please inform whether there is already an R-routine for this issue? 

Thanks in advance for the help you could provide,
Carlo Giovanni Camarda
----------
This mail has been sent through the MPI for Demographic Research.  Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance.



More information about the R-help mailing list