This link http://math.stackexchange.com/questions/18488/diagonal-of-an-inverse-of-a-sparse-matrix might help. It is about sparse matrices, but the general idea should be able to be extended to non-sparse matrices as well.
On Fri, Apr 19, 2013 at 8:13 AM, Camarda, Carlo Giovanni < cama...@demogr.mpg.de> wrote: > 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. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.