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

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Poisson CDF evaluater with linear approximation for real-valued n's.

To handle multi-reads properly, we do linear interpolation of the cdf 
between floor(n) and ceil(n).

        def poisson_cdf (n, lam, lower=True):
    """Poisson CDF evaluater with linear approximation for real-valued n's.
    
    To handle multi-reads properly, we do linear interpolation of the cdf 
    between floor(n) and ceil(n).
    """
    lam = round(lam, 4)
    #lam = int((lam + .0005) * 1000) / 1000.   # speedup-- round lambda to thousands place
    floor_n = floor(n)
    ceil_n = floor_n + 1
    floor_cdf = _poisson_cdf(floor_n, lam, lower)
    ceil_cdf = _poisson_cdf(ceil_n, lam, lower)
    mid_cdf = floor_cdf + (n - floor_n) * (ceil_cdf - floor_cdf)
    return mid_cdf
        


src/a/r/AREM-1.0.1/AREM/PeakDetect.py   AREM(Download)
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 *