[R] matrix vectorization or something else??

2009-04-02 Thread Kutlwano Ramaboa
Hello This may have been answered elsewhere, and I have looked on the web, but nothing helps. I am trying to do the following: X<-matrix(c(1:15),nrow=3,byrow=T) Y<-matrix(c(2,4,6,8,10),ncol=1) I need to sum the product of each row of X by the remaining j rows multiplied by j y values (i.e s

Re: [R] matrix vectorization or something else??

2009-04-02 Thread David Winsemius
Generally unambiguous questions get answered quickly. Perhaps other readers are having the same difficulties I am experiencing. So let's try to parse what you are asking: On Apr 2, 2009, at 8:26 AM, Kutlwano Ramaboa wrote: Hello This may have been answered elsewhere, and I have looked on t

Re: [R] matrix vectorization or something else??

2009-04-02 Thread Kutlwano Ramaboa
Agree, it is ambiguous. Will try again Suppose I have the following X<-matrix(c(1:20),nrow=4,byrow=T), hence this is a 4 by 5 matrix Y<-matrix(c(2,4,6,8),ncol=1), and this is a 4 by 1 vector, each value denote y1, y2,y3, y4 Step 1 - write each row of X as a vector, so I have vectors t(x_

Re: [R] matrix vectorization or something else??

2009-04-03 Thread David Winsemius
On Apr 3, 2009, at 1:36 AM, Kutlwano Ramaboa wrote: Agree, it is ambiguous. Will try again Suppose I have the following X<-matrix(c(1:20),nrow=4,byrow=T), hence this is a 4 by 5 matrix Y<-matrix(c(2,4,6,8),ncol=1), and this is a 4 by 1 vector, each value denote y1, y2,y3, y4 Step 1