logger.debug("poisson for lambda = " + lambda); logger.debug("poisson for prob = " + prob); logger.debug("poisson for x = " + x); logger.debug("poisson for intervalLength = " + intervalLength); logger.debug("poisson for interval = " + interval);
if (logger.isDebugEnabled()) logger.debug("poisson for lambda = " + lambda); if (logger.isDebugEnabled()) logger.debug("poisson for prob = " + prob); if (logger.isDebugEnabled()) logger.debug("poisson for x = " + x); if (logger.isDebugEnabled()) logger.debug("poisson for intervalLength = " + intervalLength); if (logger.isDebugEnabled()) logger.debug("poisson for interval = " + interval);
    public double computeIntervalProbability(long start, long end) {                 long interval = end - start;        double x = (double)intervalLength / (double)interval ;        double lambda = prob / (x);                logger.debug("poisson for lambda = " + lambda);        logger.debug("poisson for prob = " + prob);        logger.debug("poisson for x = " + x);        logger.debug("poisson for intervalLength = " + intervalLength);        logger.debug("poisson for interval = " + interval);                double result = 0.0;        PoissonDistribution pd = null;        try {             pd = new PoissonDistribution(lambda);        } catch (Exception e) {             logger.error("Exception creating poisson probability. Returning probability = 0.", e);            return result;        }                        try {            //Get probability of all occurences > 0 (pd.probability(0) is the prob of no occurrences, so            // 1-pd.probability(0) is the prob of any occurrence in the interval.            result = 1 - pd.probability(0);        } catch (Exception e) {             logger.error("Exception generating poisson probability. Returning probability = 0.", e);        }                return result;    }