Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: vectorizing code in Mata


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: vectorizing code in Mata
Date   Tue, 4 Oct 2011 10:10:31 -0400

Patrick Roland <patrick.rolande@gmail.com>:
These kinds of things can be pretty problem-specific.  Sometimes a
faster matrix-algebra-style calculation can choke on memory
constraints, too, where an only slightly slower loop can function just
fine: http://www.stata.com/statalist/archive/2009-05/msg00841.html

On Mon, Oct 3, 2011 at 7:43 PM, Patrick Roland
<patrick.rolande@gmail.com> wrote:
> I was wondering if people have experience with the kinds of
> performance gains that occur from vectorizing code (rather than
> looping) in Mata. Here it gives an example of where mata is fast
> enough to work at the element level:
> http://www.stata.com/whystata/intromata.html. Are the speed gains from
> vectorization less than would be realized in, say, MATLAB?
>
> More generally, what are the things to do or to avoid if one wants to
> write fast Mata code?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index