commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <>
Subject Re: [math] releasing 2.0 ?
Date Mon, 06 Apr 2009 03:29:00 GMT
I should probably put this comment onto the issue itself, but for very large
values of lambda, the sampled count becomes very close to Gaussian which
would imply that there are very simple rejection algorithms based on
standard techniques such as sampling from the normal or Lorentzian and
rejecting.  See, for instance, Hormann's articles: and

Both of these articles are from a somewhat dated point of view (he worries
about requiring "more than 2" uniform deviates on average" or requiring a
"fast normal deviate generator").  Our sensibilities about the relative cost
of code complexity versus number of operations have changed enough that I
would expect that even simpler methods are now possible.

On Sun, Apr 5, 2009 at 8:11 PM, Phil Steitz <> wrote:

> Brent Worden wrote:
>> Phil Steitz wrote:
>>> I will look at MATH-197 if Brent does not catch this.
>>>  Thanks for nudging me to actually contribute something. :)
>> I added a rejection method for Poisson random variables.  As Luc mentioned
>> in the issue, the original approach experienced numerical instability for
>> larger mean values.  The new rejection method seems to be stable for means
>> over 100,000.  I tried a mean of 1,000,000 and the performance was
>> unsatisfactory.
>> I checked in the implementation.  Feel free to check out the code and make
>> any suggestions.
> Thanks!
>> Also, I didn't close the issue as I'll let the more active committers
>> determine if this addresses the problem in a satisfactory manner.
> I will do some more testing, but it looks good to me.
> Thanks again.  If you have any spare cycles, it would be great if you could
> provide suggestions (or implement them ;) for improvements to the multiple
> regression classes.  Also,  if you have time, hava a look at the GA
> implementation code added in MATH-207.  I am leaning toward committing the
> last patch with minor doc changes and making the randomness source
> pluggable.
> Phil
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Ted Dunning, CTO

111 West Evelyn Ave. Ste. 202
Sunnyvale, CA 94086
858-414-0013 (m)
408-773-0220 (fax)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message