[Numpy-tickets] [NumPy] #921: numpy.random.hypergeometric: error for some cases

NumPy numpy-tickets@scipy....
Thu Oct 2 21:09:05 CDT 2008


#921: numpy.random.hypergeometric: error for some cases
--------------------------+-------------------------------------------------
 Reporter:  josefpktd     |        Owner:  somebody
     Type:  defect        |       Status:  new     
 Priority:  normal        |    Milestone:          
Component:  numpy.random  |      Version:  none    
 Severity:  normal        |   Resolution:          
 Keywords:                |  
--------------------------+-------------------------------------------------
Comment (by josefpktd):

 I think I found the error

 http://scipy.org/scipy/numpy/browser/trunk/numpy/random/mtrand/distributions.c

 {{{
 805         /* this is a correction to HRUA* by Ivan Frohne in rv.py */
 806         if (good > bad) Z = m - Z;
 }}}

 Quickly looking at the referenced program,
 downloaded from: http://pal.ece.iisc.ernet.in/~dhani/frohne/rv.py

 Notation: alpha = bad, beta = good:

 {{{
                if alpha > beta:           # Error in HRUA*, this is
 correct.
                   z = m - z
 }}}

 As you can see, if my interpretation is correct, then line 806 should have
 good and bad reversed, i.e.

 {{{
 806         if (bad > good) Z = m - Z;
 }}}

 Josef

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/921#comment:1>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list