Examples of CumulativePoissonDistribution


Examples of org.jquantlib.math.distributions.CumulativePoissonDistribution

                0.9997737463333305, };



        for (double mean=0.0; mean<=10.0; mean+=0.5) {
            final CumulativePoissonDistribution cdf = new CumulativePoissonDistribution(mean);

            int i = 0;
            double cumCalculated = cdf.op(i);
            double logHelper = -mean;
            double cumExpected = Math.exp(logHelper);
            double error = Math.abs(cumCalculated-cumExpected);
            if (error>1.0e-13) {
                fail("expected: " + cumExpected + "  calculated: " + cumCalculated + "  error: " + error);
            }

            for (i=1; i<25; i++) {
                cumCalculated = cdf.op(i);
                if (mean == 0.0) {
                    cumExpected = 1.0;
                } else {
                    logHelper = logHelper+Math.log(mean)-Math.log(i);
                    cumExpected += Math.exp(logHelper);
View Full Code Here

Examples of org.jquantlib.math.distributions.CumulativePoissonDistribution

          CumulativeNormalDistribution cnd = new CumulativeNormalDistribution(mean, sigma);
      return     cnd.op(z);
      }

      public  static double evaluateCumulativePoissonDistribution(double mean, int k){
          CumulativePoissonDistribution cpd = new CumulativePoissonDistribution(mean);
          return cpd.op(k);

      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.