Re: [R] Matrix package: band matrix

2009-02-22 Thread Thomas Lumley
Exactly what I wanted. Thanks much. -thomas On Sat, 21 Feb 2009, Martin Maechler wrote: "KK" == Ken Knoblauch on Fri, 20 Feb 2009 14:11:55 + (UTC) writes: KK> Thomas Lumley u.washington.edu> writes: >> I want to construct a symmetric band matrix in the Matrix >> pa

Re: [R] Matrix package: band matrix

2009-02-20 Thread Martin Maechler
> "KK" == Ken Knoblauch > on Fri, 20 Feb 2009 14:11:55 + (UTC) writes: KK> Thomas Lumley u.washington.edu> writes: >> 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,

Re: [R] Matrix package: band matrix

2009-02-20 Thread Martin Maechler
> "TL" == Thomas Lumley > on Fri, 20 Feb 2009 05:49:10 -0800 (PST) writes: TL> On Fri, 20 Feb 2009, David Winsemius wrote: >> If you can tolerate the subdiagonal and superdiagonal zero elements being >> populated, then perhaps this is useful. If there is a subset functio

Re: [R] Matrix package: band matrix

2009-02-20 Thread David Winsemius
Then? : xxx <- data.frame(x1 =rnorm(5), offd= c(1:4,0) ) M <-Matrix(0,5,5) rrr <- dim(M)[1] for (rr in 1:rrr){ M[rr,rr] <- xxx$x1[rr] } for (rr in 1:(rrr-1)){ M[rr+1,rr] <- xxx$offd[rr] ; M[rr,rr+1] <- xxx $offd[rr]} > M 5 x 5 sparse Matrix of class "dgCMatrix" [1,] -1.494930 1.000 .

Re: [R] Matrix package: band matrix

2009-02-20 Thread Ken Knoblauch
Thomas Lumley u.washington.edu> writes: > 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

Re: [R] Matrix package: band matrix

2009-02-20 Thread Thomas Lumley
On Fri, 20 Feb 2009, David Winsemius wrote: If you can tolerate the subdiagonal and superdiagonal zero elements being populated, then perhaps this is useful. If there is a subset function as you suggest, then perhaps further reduction would be feasible from this as a starting point. At least i

Re: [R] Matrix package: band matrix

2009-02-20 Thread David Winsemius
If you can tolerate the subdiagonal and superdiagonal zero elements being populated, then perhaps this is useful. If there is a subset function as you suggest, then perhaps further reduction would be feasible from this as a starting point. At least it would reduce the size from 10^5 x 10^5

[R] Matrix package: band matrix

2009-02-19 Thread Thomas Lumley
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 ele