Package org.jquantlib.math

Examples of org.jquantlib.math.RegularisedIncompleteBeta


  @Test
  public void testRegIncompleteBetaHartleyFitchExamples() {


    final RegularisedIncompleteBeta beta = new RegularisedIncompleteBeta();

    // FIXME Is 1.0e-6 accuracy ok?
    final double[][] values = { {30, 5, 0.7, 0.0116578},
                {30, 5, 0.94, 0.94936},
                {30, 5, 0.96, 0.989182},
                {10, 16, 0.2, 0.0173319},
                {16, 10, 0.8, 0.982668},
                { 42, 0.89, 0.903488},
                { 42, 0.42, 0.103308}};

    for (final double[] value : values) {
      final double a = value[0];
      final double b = value[1];
      final double x = value[2];
      final double expected = value[3];
      final double realised = beta.evaluate(x, a, b);
      if (Math.abs(expected-realised)>1.0e-6)
        fail("x: " + x + " expected: " + expected + " realised: " + realised);
    }
  }
View Full Code Here

TOP

Related Classes of org.jquantlib.math.RegularisedIncompleteBeta

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.