[R] efficiently multiply different matrices in 3-d array with different vectors?
Ranjan Maitra
maitra.mbox.ignored at inbox.com
Fri Dec 28 06:33:01 CET 2012
Hello,
I have been wondering of an efficient way to do this:
I have an n x m x p array Z and a p x n matrix Y.
I want to multiply each of the n matrices with the corresponding column
vector of Y.
In other words, I am wanting to matrix multiply:
Z[i, ,] %*% Y[, i]
which will give me a (two-dimensional) array or matrix of dimension n x
p with the i'th row storing the above.
Any pointers on an efficient way of doing this? I considered using
apply, but was not successful.
Many thanks again and best wishes,
Ranjan
--
Important Notice: This mailbox is ignored: e-mails are set to be
deleted on receipt. For those needing to send personal or professional
e-mail, please use appropriate addresses.
____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!
More information about the R-help
mailing list