[R] Matrix mulitplication
(Ted Harding)
Ted.Harding at nessie.mcc.ac.uk
Mon Feb 16 23:35:46 CET 2004
On 16-Feb-04 Grace Conlon wrote:
> ABCD are four matrix.
> A * Inverse((Transpose(A)*Tranpose(B)*B*A+C)) * Transpose(A) *
> Transpose(B) * D
>
> how to write in R in an efficient way?
The only "efficiency saving" I can see here is to evaluate transposes
only once:
At <- t(A)
Bt <- t(B)
A%*%solve(At%*%Bt%*%B%*%A + C)%*%At%*%Bt%*%D
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 16-Feb-04 Time: 22:35:46
------------------------------ XFMail ------------------------------
More information about the R-help
mailing list