Skip to content
Prev 171008 / 398503 Next

Matrix package: band matrix

I want to construct a symmetric band matrix in the Matrix package from a matrix where the first column contains data for the main diagonal, the second column has data for the first subdiagonal/superdiagonal and so on.

Since the Matrix will be 10^5 x 10^5 or so, with perhaps 10-20 non-zero elements above the diagonal per row, I can't do it by constructing a full matrix and then using the band() function to subset it to a band matrix.

Any suggestions?

       -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle