[Numpy-discussion] random_array.poisson(0) gives -1 and -2

Todd Miller jmiller at stsci.edu
Wed May 19 12:05:04 CDT 2004


On Wed, 2004-05-19 at 14:25, Sebastian Haase wrote:
> Hi,
> the random_array poisson functions returns negative values if mean=0:
> >>>from numarray import random_array as ra
> >>> ra.seed(x=1, y=1)
> >>> ra.poisson(0)
> 5
> >>> ra.poisson(0)
> -2
> 
> My "math book" tells me that it should be always zero.
> This seems to be a constructed case, but I'm using this to put
> "quantum statistic" into a simulated image:
> obj = na.array( something )
> imageFromDetector = ra.poisson( obj ) + gaussianNoiseArray
> The object array might have lots of zeros surrounding the "actual object". 
> Thinking of a fluorescent object sending out photons it makes sense to not get 
> any photons at all from 'empty' regions.
> I'm using numarray 0.8;

I tried this on Fedora-1 i386 with Python-2.3.3 and it returned zero
consistently.  What platform are you on?

Regards,
Todd









More information about the Numpy-discussion mailing list