[Numpy-discussion] problem with poisson generators

David M. Cooke cookedm at physics.mcmaster.ca
Wed Jul 13 08:28:41 EDT 2005


On Tue, Jul 12, 2005 at 05:32:25PM -0300, Flavio Coelho wrote:
> Hi,
> 
> I am having problems with the poisson random number generators of both 
> Numarray and Numeric.
> I can't replicate it when calling the function from the python cosonle, but 
> it has consistently malfunctioned when used within one of my scripts.
> 
> What happens is that it frequently return a value greater than zero when 
> called with zero mean: poisson(0.0)
> 
> Unfortunately My program is too big to send attached but I have confirmed 
> the malfunction by printing both the mean and the result whenever it spits 
> out a wrong result.
> 
> This is very weird indeed, I have run poisson millions of times by itsel on 
> the python console, without any problems...
> 
> I hope it is some stupid mistake, but when I replace the poisson function 
> call within my program by the R equivalent command (rpois) via the rpy 
> wrapper, everything works just fine... 
> 
> any Ideas?

This looks like bug #1123145 in Numeric:

http://sourceforge.net/tracker/index.php?func=detail&aid=1123145&group_id=1369&atid=101369

which was fixed a few months ago. numarray, I believe, originally took
ranlib.c from Numeric, so it doesn't have this bug fix. Try replacing
numarray's ranlib.c with the version from Numeric 24.0b2 (or CVS).

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the NumPy-Discussion mailing list