[R-sig-dyn-mod] Vectorizing
This is all very helpful--thanks to both you and Thomas Believe me, I'm not going to try ABM with R--that seems way above my pay grade--I'll be happy if I can do some basic simulations of populations with R. (I leave my ABM work to AnyLogic and commercial packages) Thanks again -- E. Michael Foster Professor, Department of Health Care Organization and Policy School of Public Health The University of Alabama at Birmingham -----Original Message----- From: r-sig-dynamic-models-bounces at r-project.org [mailto:r-sig-dynamic-models-bounces at r-project.org] On Behalf Of Stephen Ellner Sent: Monday, November 07, 2011 9:39 AM To: r-sig-dynamic-models at r-project.org Subject: [R-sig-dyn-mod] Vectorizing 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 * _______________________________________________ R-sig-dynamic-models mailing list R-sig-dynamic-models at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models