[SciPy-user] Is this a bug in stats.geom.pmf?

Fernando Perez fperez.net@gmail....
Mon Jun 25 15:59:09 CDT 2007


Hi all,

just curious.  The stats.geom docstring says:

    Geometric distribution

    geom.pmf(k,p) = (1-p)**(k-1)*p
    for k >= 1

But I see this:

In [10]: k,p = 2.0,0.5

In [11]: (1-p)**(k-1)*p
Out[11]: 0.25

In [12]: stats.geom.pmf(k,p)
Out[12]: array(0.125)

However:

In [13]: stats.geom.pmf(k-1,p)
Out[13]: array(0.25)


Is this an off-by-one bug, or am I misreading something here?

Cheers,

f


More information about the SciPy-user mailing list