Package org.jquantlib.math.distributions

Examples of org.jquantlib.math.distributions.CumulativePoissonDistribution.op()


        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);
View Full Code Here


            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

      return     cnd.op(z);
      }

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

      }

          public static double evaluateGammaDistribution(double a, double x) {
              GammaDistribution gd = new GammaDistribution(a);
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.