[Numpy-discussion] multinomial question

Robert Kern robert.kern@gmail....
Wed Dec 5 20:34:41 CST 2007

Alan G Isaac wrote:
> I would think that
>     multinomial(1,prob,size=ntrials).sum(axis=0)
> would be equivalent to
>     multinomial(ntrials,prob)
> but the first gives a surprising result.  (See below.)
> Explanation?

A bug in rk_binomial_inversion(). Unfortunately, this looks like a logical bug
in the sources I was deriving this code from. The "safety bound" on the search
inversion search cuts out too early. Now that I re-examine it, it looks the
bound (whichever of the multiple choice of bounds one could use) could always be
legitimately exceeded, so there shouldn't be a bound at all. I'll have to dive
deeper to figure out what is going on. This makes me grumpy.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the Numpy-discussion mailing list