Check out crossprod and the Matrix package (capitalized); there's also
a discussion of their speed gains in the R newsletter that should turn
up with a search and in the vignette as well.
-Gray
On Monday, December 14, 2009, parkbomee <bbom419 at hotmail.com>
wrote:>
>
>
>
>
>
> Hi all,
>
> Is there a way to do a matrix multiplication in a faster way?
> I am making a product of a matrix (composed of a lot of dummy variables)
and a vector, and is there any way to make it faster?
> The simple X %*% y takes too long a time.
> I know using sparse matrix would help, but don't know how to do it i R.
>
>
> Thank you.
>
>
>
> _________________________________________________________________
> [[elided Hotmail spam]]
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org?mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Gray Calhoun
Assistant Professor of Economics
Iowa State University