Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# AREM.Prob.poisson_cdf_inv

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
```inverse poisson distribution.

cdf : the CDF
lam : the lambda of poisson distribution

note: maxmimum return value is 1000
and lambda must be smaller than 740.
```

```        def poisson_cdf_inv ( cdf, lam, maximum=1000):
"""inverse poisson distribution.

cdf : the CDF
lam : the lambda of poisson distribution

note: maxmimum return value is 1000
and lambda must be smaller than 740.
"""
assert lam < 740
if cdf < 0 or cdf > 1:
raise Exception ("CDF must >= 0 and <= 1")
elif cdf == 0:
return 0
sum2 = 0
newval = exp( -lam )
sum2 = newval
#     if cdf <= sum2:
#         return i

for i in xrange(1,maximum+1):
sumold = sum2
#         if i == 0:
#             newval = exp( -a )
#             if newval==0:
#                 newval = 4.9406564584124654e-324
#             sum2 = newval
#         else:
last = newval
newval = last * lam / i
sum2 = sum2 + newval
if sumold <= cdf and cdf <= sum2:
return i

return maximum
```

```from AREM.OutputWriter import zwig_write,zbdg_write
from AREM.IO.FeatIO import PeakIO,WigTrackI,BinKeeperI
from AREM.Prob import poisson_cdf,poisson_cdf_inv
from AREM.Constants import *

```
```        """
lambda_bg0 = float(self.scan_window)*trackI.total/self.gsize # bug fixed...
min_tags = poisson_cdf_inv(1-pow(10,self.pvalue/-10),lambda_bg0)+1
prob_aligns = trackI.prob_aligns
peak_candidates = {}
```