Package org.jquantlib.math.distributions

Examples of org.jquantlib.math.distributions.GammaDistribution


                  {14.0, 7.665444025768806E-9},
                  {15.0, 2.659774281674882E-9}};

    // Test for a = 1.0 (alpha)
    double a = 1.0;
    final GammaDistribution gammDistribution = new GammaDistribution(a);
    for (final double[] testvalue : testvalues) {
      final double expected = testvalue[1];
      final double x = testvalue[0];
      final double computed = gammDistribution.op(x);
      // QL.info(computed); // for testing
      final double tolerance = 1.0e-15;
      if (Math.abs(expected-computed)>tolerance) {
        fail("x: " + x + " expected: " + expected + " realised: " + computed);
      }
    }

    // Test for a = 0.1 (alpha)
    a = 0.1;
    final GammaDistribution gammDist = new GammaDistribution(a);
    for (final double[] element : testvalues2) {
      final double expected = element[1];
      final double x = element[0];
      final double computed = gammDist.op(x);
      // QL.info(computed); // for testing
      final double tolerance = 1.0e-15;
      if (Math.abs(expected-computed)>tolerance) {
        fail("x: " + x + " expected: " + expected + " realised: " + computed);
      }
View Full Code Here


          return cpd.op(k);

      }

          public static double evaluateGammaDistribution(double a, double x) {
              GammaDistribution gd = new GammaDistribution(a);
              return gd.op(x);
          }
View Full Code Here

TOP

Related Classes of org.jquantlib.math.distributions.GammaDistribution

Copyright © 2018 www.massapicom. 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.