|
|
Re: Simulating iid Poisson variates
Posted:
Jun 20, 1996 3:46 PM
|
|
In article <4q70c6$i9c@geraldo.cc.utexas.edu>, bill@clyde.as.utexas.edu (William H. Jefferys) writes: > I need to simulate iid Poisson variates for a Monte Carlo > calculation. I can do it by brute force; are there any > more elegant or convenient ways?
Certainly, it's nice to be aware of one's options and to learn new tricks, but I'd like to make a pitch for brute force when the only concern is getting the job done quickly and correctly.
Recently, I had a collection of a 10,000 items to look up in a master list of 400. I've done this task so often on mainframes when CPU time was at a premium that I can write a binary search in my sleep. But since I've now got a (slow!) P90 on my desk, I decided to write a simple loop and perform all potential 4,000,000 comparisons. I barely had time to breathe before the machine was done (only a slight exageration). No doubt, I could've cut down the execution time dramatically, but thesavings would've been infinitessimal compared to the (short) additional programming time. I'm convinced there's nothing to be gained by elegance here even if I had to run this job many times each day.
Of course, if you've got a truly massive job, elegance can be critical, but elegance often provides many entry points for errors in coding and logic that quickly erases potential gains.
|
|