This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pdtri gives wrong results
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: funke_, georg.brandl
Priority: normal Keywords:

Created on 2007-06-29 07:14 by funke_, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg32424 - (view) Author: Nikke Knatterton (funke_) Date: 2007-06-29 07:14
pdtri function, aka inverse of Poisson cumulative distribution gives wrong results when I use it.
For example when expected count is 20:

>>> pdtri(20,0.001)
38.041881353850023

when in Matlab:

>> poissinv(0.999, 20)
ans = 35

I checked the value from http://stattrek.com/Tables/Poisson.aspx
where cumulative probability for 35 is 0.999196 and for 
38 it is 0.999891...clearly the latter is wrong.

Or don't I use the function correctly?

(For some reason the probability 0.999 is given as 0.001 in python)
msg32425 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-06-29 07:33
There is no "pdtri" function in the Python core and standard library.

If this function is coming from SciPy, you should report or discuss that issue with them.
History
Date User Action Args
2022-04-11 14:56:25adminsetgithub: 45140
2007-06-29 07:14:26funke_create