From: JJ <jos...@ya...> - 2006-07-12 00:01:06
|
Am I using the wrong syntax for the binom.ppf command, or is there a bug? >>> stats.binom.ppf(.975,100,.5) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib64/python2.4/site-packages/scipy/stats/distributions.py", line 3590, in ppf insert(output,cond,self._ppf(*goodargs) + loc) File "/usr/lib64/python2.4/site-packages/numpy/lib/function_base.py", line 501, in insert return _insert(arr, mask, vals) TypeError: array cannot be safely cast to required type >>> ----------------- The info pages for binom.ppf state that: binom.ppf(q,n,pr,loc=0) - percent point function (inverse of cdf --- percentiles) So I would expect binom.ppf to take three variables. I expected the function to return a number, such as is done in matlab: N = 100 alpha = 0.05 p1 = 0.30 cutoff = binoinv(1-alpha, N, p1) cutoff = 38 Any suggestions? JJ |