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
> "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,
> "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
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 .
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
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
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
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
8 matches
Mail list logo