[SciPy-user] problems with stats

danny shevitz danny_shevitz at yahoo.com
Tue Apr 27 13:43:03 EDT 2004


Howdy,

I've encountered two problems with the binomial distribution in the
stats module. The first is trivial and I believe just an argument
checking problem.

>>> binom.pdf(0,3,.5)

bdtr domain error
1.#QNAN

(the answer should be .125 of course)

The second is a little more significant. I'm trying to invert the
binomial distribution using ppf. I looked at distributions.py

class binom_gen(rv_discrete):
    .
    .
    .
    def _ppf(self, q, n, pr):
        vals = ceil(special.bdtrik(q,n,pr))
        vals1 = vals-1
        temp = special.bdtr(vals1,n,pr)
        return where(temp >= q, vals1, vals)

and ppf is in fact implemented, but when I try to run it I get an
error.

>>> binom.ppf(3,4,.95)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File ".\site-packages\scipy\stats\distributions.py", line 2371, in
ppf
TypeError: _ppf() takes exactly 4 arguments (3 given)

Does anyone know what's going on. Am I misusing something?

thanks,
Danny



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 




More information about the SciPy-User mailing list