[SciPy-dev] hypergeom or me?

josef.pktd@gmai... josef.pktd@gmai...
Fri Aug 29 13:26:30 CDT 2008


Is this correct? scipy 0.6.0:

>>> stats.hypergeom.rvs(33, 18, 6, size=10)
array([3, 4, 4, 4, 3, 3, 2, 2, 4, 3])
>>> stats.hypergeom.rvs(33, 6, 18, size=10)
array([24, 24, 25, 22, 24, 23, 24, 25, 25, 23])
>>> stats.hypergeom.pmf(range(20),33, 18, 6)
array([ 0.00451891,  0.04880423,  0.18856179,  0.33522095,  0.29009506,
        0.11603802,  0.01676105,  0.        ,  0.        ,  0.        ,
        0.        ,  0.        ,  0.        ,  0.        ,  0.        ,
        0.        ,  0.        ,  0.        ,  0.        ,  0.        ])
>>> stats.hypergeom.pmf(range(20),33, 6, 18)
array([ 0.00451891,  0.04880423,  0.18856179,  0.33522095,  0.29009506,
        0.11603802,  0.01676105,  0.        ,  0.        ,  0.        ,
        0.        ,  0.        ,  0.        ,  0.        ,  0.        ,
        0.        ,  0.        ,  0.        ,  0.        ,  0.        ])
>>> stats.hypergeom.cdf(range(20),33, 18, 6)
array([ 0.00451891,  0.05332314,  0.24188492,  0.57710588,  0.86720093,
        0.98323895,  1.        ,  1.        ,  1.        ,  1.        ,
        1.        ,  1.        ,  1.        ,  1.        ,  1.        ,
        1.        ,  1.        ,  1.        ,  1.        ,  1.        ])
>>> stats.hypergeom.cdf(range(20),33, 6, 18)
array([ 0.00451891,  0.05332314,  0.24188492,  0.57710588,  0.86720093,
        0.98323895,  1.        ,  1.        ,  1.        ,  1.        ,
        1.        ,  1.        ,  1.        ,  1.        ,  1.        ,
        1.        ,  1.        ,  1.        ,  1.        ,  1.        ])

Josef


More information about the Scipy-dev mailing list