[R-sig-dyn-mod] Vectorizing
Stephen Ellner
spe2 at cornell.edu
Mon Nov 7 16:38:55 CET 2011
Unfortunately, the only method I know for mastering vectorizing is practice, practice, practice,
after looking at the pointers that Thomas suggested. The PDE application that I
described worked in R because it was possible to compute once-and-for-all matrices such that
all the calculations needed to compute approximate spatial derivatives were done with
two matrix-vector multiplications (one each for first and second derivatives). I have
very little experience with ABMs, so I don't know how frequently there are tricks like
that which make loops go away. Maybe others on this list can provide some examples?
Steve Ellner
>Date: Sun, 6 Nov 2011 07:34:24 -0600
>From: E Michael Foster <emfoster at uab.edu>
>To: Special Interest Group for Dynamic Simulation Models in R
> <r-sig-dynamic-models at r-project.org>
>
>Thanks so much for taking the time to respond.
>
>This is kind of what I feared and I know about the benefits of vectorizing calculations.
>My difficulty is that the idea of loops is so drilled into my brain
>
>Know of a good resource for mastering vectorizing calculations?
>Googling, I certainly can see plenty of instances where folks are asking for help on technical problems--
>
>E. Michael Foster
>Professor, Department of Health Care Organization and Policy
>School of Public Health
>The University of Alabama at Birmingham
Stephen P. Ellner (spe2 at cornell.edu)
Department of Ecology and Evolutionary Biology
Corson Hall, Cornell University, Ithaca NY 14853-2701
Phone (607) 254-4221 FAX (607) 255-8088
* This is my work email. I try not to read it at other times *
More information about the R-sig-dynamic-models
mailing list