[SciPy-dev] hypergeom or me?
josef.pktd@gmai...
josef.pktd@gmai...
Fri Aug 29 13:49:27 CDT 2008
almost done,
there is no upper bound check in Boltzmann, i.e k<=N
according to docstring should be
pmf = 0 for k>N
cdf = 1 for k>N instead cd > 1
>>> stats.boltzmann.rvs(0.5, 5, size=10)
array([4, 1, 4, 0, 0, 1, 0, 0, 1, 1])
>>> stats.boltzmann.pmf(range(20),0.5, 5)
array([ 4.28655529e-01, 2.59992721e-01, 1.57693556e-01,
9.56459768e-02, 5.80122174e-02, 3.51861885e-02,
2.13415021e-02, 1.29442754e-02, 7.85109987e-03,
4.76193279e-03, 2.88825823e-03, 1.75181717e-03,
1.06253082e-03, 6.44457522e-04, 3.90883246e-04,
2.37082673e-04, 1.43797910e-04, 8.72178413e-05,
5.29002948e-05, 3.20856507e-05])
>>> stats.boltzmann.cdf(range(20),0.5, 5)
array([ 0.42865553, 0.68864825, 0.84634181, 0.94198778, 1. ,
1.03518619, 1.05652769, 1.06947197, 1.07732307, 1.082085 ,
1.08497326, 1.08672507, 1.0877876 , 1.08843206, 1.08882295,
1.08906003, 1.08920383, 1.08929104, 1.08934394, 1.08937603])
More information about the Scipy-dev
mailing list