[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Mata slow?
firstname.lastname@example.org (William Gould, Stata) writes:
> In the case of the code Brendan Halpin <email@example.com> reported,
> execution time was .0228 seconds after improvement. That was with 100x100
> matrices and I wonder how large the matrices were that Brendan was using. In
> any case, 20 times faster reduces the run time to 0.00114, a savings of .02166
> seconds. That absolute number, while not large, is big enough to catch my
> interest, which is why I've been timing indidvidual statements this morning.
Thanks for the response. It's enlightening, even in some of the
incidentals. My actual algorithm uses even more of those
inefficient nested for-loops, but the real problem is that the end
use is to calculate pairwise proximity data, so it gets called
However, I take your point -- within limits time is not that
important, and coding time is often more important than execution
time. I've been playing with Mata for a week and have firstly been
able to express this algorithm very concisely, and secondly
implemented three or four other proximity measures that I might not
have attempted in C. Plus I'm recalling things I didn't know I knew
about matrix algebra!
Brendan Halpin, Department of Sociology, University of Limerick, Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147
* For searches and help try: