[SciPy-User] NumPy Binomial BTPE method Problem

Josh Lawrence josh.k.lawrence@gmail....
Wed Oct 3 16:42:53 CDT 2012


Hah, my pleasure. I'm surprised I found them, as your code seems to
always work so well.

On Wed, Oct 3, 2012 at 4:28 PM, Robert Kern <robert.kern@gmail.com> wrote:
> On Wed, Oct 3, 2012 at 5:54 PM, Josh Lawrence <josh.k.lawrence@gmail.com> wrote:
>> Hello all,
>>
>> I am implementing a binomial random variable in MATLAB. The default
>> method in the statistics toolbox is extremely slow for large
>> population/trial size. I am needing to do trials for n as large as
>> 2**28. I found in NumPy some code that implements a binomial random
>> draw in numpy/random/mtrand/distributions.c. I was trying to convert
>> the code to MATLAB and the BTPE method seems to have an error in lines
>> 337-341 of distributions.c. The if ... else if ... else statement I
>> think is incorrect. I think it should be an if ... else ... statement
>> followed by the contents of the original else which starts on line
>> 337.
>
> Yes, you are correct, on this point as well as the m+1 and y+1. Thank
> you for debugging my code!
>
> --
> Robert Kern
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user



-- 
Josh Lawrence


More information about the SciPy-User mailing list