Package org.jquantlib.math.distributions

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


        final int n = testvalues.length;      // number of trials

        final CumulativeBinomialDistribution cumbinomdist = new CumulativeBinomialDistribution(p,n);
        for (int i=0;i<testvalues.length;i++) {
            final double expected = testvalues[i];
            final double realised = cumbinomdist.op(i); // i = number of successful events
            final double tolerance = 1.0e-11;
            if (Math.abs(expected-realised)>tolerance) {
                fail("x: " + i + " expected: " + expected + " realised: " + realised);
            }
        }
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.